SUMX(LOCAL)                                           SUMX(LOCAL)

       sumx - sum numbers in input column

       sumx [-f #] [-a #] [-d] [-y] [-v [-i]] [col#] [files]

       Sumx  sums  numbers  from its input (one number per line).
       If no column is specified, the first whitespace  delimited
       column  is  used.   Columns  are normally counted from the
       left, however, the column expression NF-1  refers  to  the
       second to last column in each line, etc.

       If  the  -v  flag is given, sumx will emit each input line
       with a "running sum" of the summed  column  appended.   If
       the -i flag is also given, the -v output will have an ini-
       tial tab prepended as well.

       The -d flag is like the -v flag except the difference from
       the  previous  line  is  appended  (instead of the running

       If the -a # flag is given, an array of partial  sums  will
       be  computed such that only lines with identical values in
       the -a # column are summed together and each such  partial
       sum is emitted.  If the -v flag is also given, the running
       sum will be the running partial sum.

       Sumx can also sum numbers  in  the  form  minutes:seconds,
       hours:minutes  and hours:minutes:seconds.  Hours appearing
       as days+hours are converted to hours.  Normally, the  out-
       put  format will adapt to match the input format--that is,
       output numbers will be converted to a format which has the
       same  number  of colons (up to two) as the maximum seen in
       the input column being summed.  If -y is given, an initial
       "yymmdd@"  preceeding a time as above will be ignored.  If
       -f # is given, # can be 1, 2, or 3,  and  will  force  the
       ouput to have a format with #-1 colons.

          ls -s *.c | sumx 1

       Shows  the disk space used by the *.c files in the current

          tcpdump | sumx -d -f 1

       Appends the time difference (converted to seconds) between

          last | tr -d '()' | sumx -a 1 NF

       Sums  the  connect time for each user. Input and output in

       awk(1), ror(l)

       Corey Satten - corey @

       Any line length limits in mawk apply here as well.

       -a # in combination with -d is not implemented.