Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > How to initiali...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 11 Topic 2098 of 2317
Post > Topic >>

How to initialize an associate array nicely with awk

by "lihao0129@[EMAIL PROTECTED] " <lihao0129@[EMAIL PROTECTED] > Dec 8, 2007 at 01:57 PM

I am trying to initialize an associate array with awk, for example, to
map literal months to numeric months, I did something like:

BEGIN {
    mon["Jan"] = 1; .....; mon["Dec"] = 12;
}

Is there some other ways to do this with awk(gawk)?? for example, in
Perl , I can do things like:

 my %mon = ();
 @[EMAIL PROTECTED]
 qw/Jan Feb Mar Apr May.... / } = (1..12);

Thanks in advance,
LH
 




 11 Posts in Topic:
How to initialize an associate array nicely with awk
"lihao0129@[EMAIL PR  2007-12-08 13:57:53 
Re: How to initialize an associate array nicely with awk
Steffen Schuler <schul  2007-12-08 22:08:17 
Re: How to initialize an associate array nicely with awk ---
Steffen Schuler <schul  2007-12-08 22:10:42 
Re: How to initialize an associate array nicely with awk ---
Steffen Schuler <schul  2007-12-08 22:15:34 
Re: How to initialize an associate array nicely with awk
Steffen Schuler <schul  2007-12-08 22:19:34 
Re: How to initialize an associate array nicely with awk
"lihao0129@[EMAIL PR  2007-12-08 14:23:40 
Re: How to initialize an associate array nicely with awk
Steffen Schuler <schul  2007-12-08 22:25:15 
Re: How to initialize an associate array nicely with awk
"lihao0129@[EMAIL PR  2007-12-08 14:28:09 
Re: How to initialize an associate array nicely with awk
Ted Davis <tdavis@[EMA  2007-12-08 19:56:55 
Re: How to initialize an associate array nicely with awk
Grant <g_r_a_n_t_@[EMA  2007-12-09 13:16:31 
Re: How to initialize an associate array nicely with awk
Ted Davis <tdavis@[EMA  2007-12-09 10:52:12 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 15:14:04 CDT 2008.