hi Mikrom, I'll let you know later today. I'm not sure if the sort approach before awk will work given the size of my file (20m+ lines, 8GB size). I'll give it a try.
thanks.
Hi Mikrom, unfortunatly the server i'm using is running Solaris and there is no way to update awk with GNU, so the "asort" function does not work.
Do you know of another way to sort?
thanks.
Hi forum,
I've been away from awk in the last few years but have recently come back to it and am struggling [dazed]. Can anyone help with the following?
Summary
I have a ascii file containing 20million+ lines.
The FS = <space>
Field 1 is always an accountid. There are multiple lines per...
Just looked again at your post PHV and i changed it slightly to;
awk -F"," '{split($2,DTM,":");count[$11" "DTM[1]]++}END{for(name in count) printf "%30s - %d\n", name, (count[name]) | "sort -k1" }'
This works exactly how i wanted it too, so a big thankyou to you for your help.
Thanks for the quick reply PHV.
I neglected to say in my original post that im using Solaris
I tried running you suggestion but it hit a syntax error;
awk: syntax error near line 1
awk: illegal statement near line 1
I also tried running it through "/usr/xpg4/bin/awk" but that also hot an...
Hi,
I'm struggling trying to put together something to grab out details from many logfiles created over a 24 hour period and count how many times per hour a name appears.
I want to run through every hour (i.e. 00,01,02.....23) and print out how many times name 'x' was found.
The only fields I'm...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.