awk "for" functions

hi all,

i have these server logs:

25-04-2012;192.168.70.31;1254545454545417;500.0;SUCCESS
25-04-2012;192.168.70.32;355666650914;315126423993;;General_ERROR_23
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-201;192.168.70.34;e;null;null;ERROR_22
30-04-2012;192.168.70.37;e;null;null;Failure.
30-04-2012;192.168.70.10;e;null;null;Failure
 

and i have this two "for" funcions in my script.

 
{count[$6]++}
for(j in count) printf "%-30s %-6d\n", j, count[j]   ----> /counts number of specific errors in the sixth column/

NF>5&&!a[$6,$2]++{e[$6]++}
for (i in e) printf "%-30s %-6d\n", i, e----> /counts number of unique IPs in the second column associated in the error code in the sixth column/
 

Can i put these two "for" funcions in only one "for" function?

Thank you for you time!

Ervin

[/SIZE][/SIZE]

Stick to one thread. You're just going to cause confusion for anyone trying to help.

You could have continued here: awk count how many IP have received that error

Or waited for a reply here: awk printf format in columns

Thank you for your advise.
I just wanted a reply cause i need this for my work...also i am new to this forum.

thank u anyway :slight_smile:

You are at the brink of double posting and you have double posted before. Please stop doing that.. The subject is your particular script. Stick to one thread. I am closing this one..

Closed, continue here: