On 18/12/07 16:45:18, Robert Thorsby wrote:
> Something like the following might be close:
>
> awk 'BEGIN{FS=","}{$0~",$":i=i+NF?i=i+NF-1}END{print(i)}' input.txt
Oops, I transposed the ":" and the "?" in the conditional. Just shows
what you can do when fingers outpace brain.
Robert Thorsby
Research is what I'm doing when I don't know what I'm doing.
-- von Braun
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html