I am using the following command to sum the 3rd column in a ~ delimited file.
awk -F~ '{total+=$3} END{print total}' /tmp/foo
Can I add conditions to this command e.g. sum column 3 if column 5 greater than 160 and less than 171 etc?
Thanks
Software/Hardware used:
ASKED:
July 22, 2009 7:45 PM
UPDATED:
August 4, 2009 8:07 PM
Thanks guys. I have tried this but does not work for me. I keep getting:
awk: syntax error near line 1
awk: illegal statement near line 1
awk: illegal statement near line 1
I have tried to change a few things here and there but no go.
Cheers