@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet


Comments:

<0> if I need to make an awk script print something such as a URL, how do I get it to print characters such as " : /
<1> blah
<2> b00
<1> moo
<2> :)
<3> Greetings.



<4> Hi there !
<4> Is it possible to use regex' backrefs with awk ?
<4> I mean the popular \1 in sed, and $1 in Perl
<5> I've never used awk that way.
<3> ttz: No back references in awk.
<3> ttz: :(
<4> ok, that's what I thought. I found gensub() in gawk, it seems to undestand \n in replacement strings
<6> someone would have some arguments on this awk issue: file parsing is as fast as nominally when manually done from the BEGIN clause using an open() approach ?
<3> . . .
<6> the matter is that i need the nextfile function to jump between large datafiles but i only have nawk wich doesn't implement this
<6> so i have to implement a pre-check phase and parse only elected files, to do that i will exploit the BEGIN clause instead of simply p***ing my files as arguments
<6> create my elected files list and parse them
<7> mornin'
<8> I want to use the elements in an array as the parameter list for printf, is that possible?
<7> [@] awk 'BEGIN{a[0]="moo";a[1]="foo";printf"%s\n%s\n", a[0], a[1]}'
<7> moo
<7> foo
<8> goldfish: There is an arbitrary numer of elements.
<7> What do you mean?
<7> you want to print out an array?
<8> goldfish: Sort of, but I want to contruct a format string for them first.
<8> I want to be able to say: "Use this format string, and then use the elements in this array as the parameters to print."
<8> so like in your example, I want something like: ?printf?("%s\n%s=n", a)
<8> which would do the same thing as what your printf statement does.
<8> See?
<7> yes



<9> hi
<9> how I can get a ascii character from a ascii number ?
<9> example: 64 --> A
<9> something like ascii2char(64)
<9> thanks
<10> feistel: ask in #bash, they might help
<9> ok thanks
<10> feistel: prepare to be flamed ;/
<10> feistel: wait on this chan to ask others how to do that
<3> gnubien: You're evil.
<10> hehe
<3> gnubien: cX = sprintf("%c", 42); would do fine in awk :)
<10> explain what cX and 42 are
<3> gnubien: cX is just a variable.
<3> gnubien: awk makes no distinction between strings and characters. A "character" is a string of 1.
<10> ok
<3> gnubien: 42 is just some character value in ASCII; I think it's the "*" character.
<3> gnubien: I only memorized 65-127.
<3> gnubien: And 0 - 32.
<3> gnubien: Oh, and 48 - 57.
<10> ok, got it now, thanks
<3> gnubien: Any ASCII codes outside of those I can't remember.
<11> heath, then construct as you need it.
<12> can awk convert a string of say '20070102' to 2007-01-02?
<12> e.g. byte ranges
<11> Yes.
<12> would you use split? or IFS?
<12> excellent
<12> well that's too slow cut will have to do
<12> ahh the secret is using gawk, and not att awk


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #awk
or
Go to some related logs:

gentoo lsdev
#ubuntu
#dns
Fedora resolv.conf generated by NetworkManager
#debian
#web
Call to undefined function imagecreatefromjpeg()
migrate from gentoo ubuntu
php code round nearest 5 cents
jbalcomb



Home  |  disclaimer  |  contact  |  submit quotes