total - total numeric columns
SYNOPSIS
total [-fc] [-Dn] [-l] [-pn] [ column ... ] < table
DESCRIPTION
total
prints the sum of the values in each numeric
column
specified, or in all numeric columns if none are specified,
from
tableorlist.
OPTIONS
- -fc
- use c (instead of TAB) as the input column
separation character.
- -Dn
- turn on debugging at level n, or 1 if n
is not specified.
- -c
- carry non-numeric fields forward to the total.
This switch saves the non-numeric columns
from the first row of the table and reprints them on the total line.
- -l
- list all of the rows with the totals.
- -pn
- print totals with a precision of n places to the
right of the decimal.
EXAMPLES
$ total -c Debit Credit < journal
Date Account Debit Credit Description
---- ------- ----- ------ -----------
11/30/92 auto 65000 65000 transmission repair
$ total -l Debit Credit < ledger
Account Date Debit Credit
------- ------- ------- -------
101 890102 25000
101 890103 5000
101 890104 15000
130 890104 30000
150.1 890103 10000
201.1 890104 15000
211.1 890102 25000
211.2 890103 5000
------- ------- ------- -------
65000 65000
SEE ALSO