| 15 |
|
| |
| 16 |
|
.B \-l |
| 17 |
|
][ |
| 18 |
+ |
.B \-i{f|d}[N] |
| 19 |
+ |
][ |
| 20 |
+ |
.B \-o{f|d} |
| 21 |
+ |
][ |
| 22 |
+ |
.B "\-in M" |
| 23 |
+ |
][ |
| 24 |
+ |
.B "\-on M" |
| 25 |
+ |
][ |
| 26 |
|
.B \-tC |
| 27 |
|
][ |
| 28 |
|
.B \-N |
| 72 |
|
(A logarithmic sum of absolute values is used to avoid overflow, and |
| 73 |
|
zero values are silently ignored.) |
| 74 |
|
.PP |
| 75 |
+ |
If the input data is binary, the |
| 76 |
+ |
.I \-id |
| 77 |
+ |
or |
| 78 |
+ |
.I \-if |
| 79 |
+ |
option may be given for 64-bit double or 32-bit float values, respectively. |
| 80 |
+ |
Either option may be followed immediately by an optional |
| 81 |
+ |
count, which defaults to 1, indicating the number of double or float |
| 82 |
+ |
binary values to read per record on the input file. |
| 83 |
+ |
(There can be no space between the option and this count.)\0 |
| 84 |
+ |
Similarly, the |
| 85 |
+ |
.I \-od |
| 86 |
+ |
and |
| 87 |
+ |
.I \-of |
| 88 |
+ |
options specify binary double or float output, respectively. |
| 89 |
+ |
These options do not need a count, as this will be determined by the |
| 90 |
+ |
number of input channels. |
| 91 |
+ |
.PP |
| 92 |
|
A count can be given as the number of lines to read before |
| 93 |
|
computing a result. |
| 94 |
< |
By default, |
| 94 |
> |
Normally, |
| 95 |
|
.I total |
| 96 |
< |
reads each file to its end before producing its result, but the |
| 96 |
> |
reads each file to its end before producing its result, |
| 97 |
> |
but this behavior may be overridden by inserting blank lines in |
| 98 |
> |
the input. |
| 99 |
> |
For each blank input line, total produces a result as if the |
| 100 |
> |
end-of-file had been reached. |
| 101 |
> |
If two blank lines immediately follow each other, total closes |
| 102 |
> |
the file and proceeds to the next one (after reporting the result). |
| 103 |
> |
The |
| 104 |
|
.I \-N |
| 105 |
|
option (where N is a decimal integer) tells |
| 106 |
|
.I total |
| 109 |
|
In addition, the |
| 110 |
|
.I \-r |
| 111 |
|
option can be specified to override reinitialization and thus |
| 112 |
< |
give a running total every N lines. |
| 112 |
> |
give a running total every N lines (or every blank line). |
| 113 |
|
If the end of file is reached, the current total is printed |
| 114 |
|
and the calculation is reset before the next file (with or without the |
| 115 |
|
.I \-r |
| 116 |
|
option). |
| 117 |
|
.PP |
| 118 |
|
The |
| 119 |
+ |
.I \-in |
| 120 |
+ |
option if present, will limit the number of input records read |
| 121 |
+ |
(per input file). |
| 122 |
+ |
The |
| 123 |
+ |
.I \-on |
| 124 |
+ |
option may be used to limit the total number of outut records produced. |
| 125 |
+ |
.PP |
| 126 |
+ |
The |
| 127 |
|
.I \-tC |
| 128 |
|
option can be used to specify the input and output tab character. |
| 129 |
|
The default tab character is TAB. |
| 132 |
|
.SH EXAMPLE |
| 133 |
|
To compute the RMS value of colon-separated columns in a file: |
| 134 |
|
.IP "" .2i |
| 135 |
< |
total -t: -m -s2 input |
| 135 |
> |
total \-t: \-m \-s2 input |
| 136 |
|
.PP |
| 137 |
|
To produce a running product of values from a file: |
| 138 |
|
.IP "" .2i |
| 139 |
< |
total -p -1 -r input |
| 139 |
> |
total \-p \-1 \-r input |
| 140 |
|
.SH BUGS |
| 141 |
|
If the input files have varying numbers of columns, mean values |
| 142 |
|
will certainly be off. |
| 147 |
|
.SH AUTHOR |
| 148 |
|
Greg Ward |
| 149 |
|
.SH "SEE ALSO" |
| 150 |
< |
cnt(1), lam(1), neat(1), rcalc(1), tabfunc(1) |
| 150 |
> |
cnt(1), neaten(1), rcalc(1), rcollate(1), rlam(1), tabfunc(1) |