On Sat, 2 May 2009 00:00:15 +0200
pmarin <pacogeek_AT_gmail.com> wrote:
> Do you want to calculate only the total?
> Use hard tabs "\t" to separate columns
>
> My version:
>
> BEGIN {
> FS = "\t+"
> OFS= "\t"
> }
> $2 ~ /[0-9]+\.?[0-9]*/ {
> total["car"] += $2
> total["pro"] += $3
> total["fat"] += $4
> }
> END{
> print "Totals", total["car"], total["pro"], total["fat"]
>
Thanks! I think this will do the trick.
Received on Sat May 02 2009 - 06:36:29 UTC
This archive was generated by hypermail 2.2.0 : Sat May 02 2009 - 06:48:05 UTC