19 |
|
][ |
20 |
|
.B \-o{f|d} |
21 |
|
][ |
22 |
+ |
.B "\-in M" |
23 |
+ |
][ |
24 |
+ |
.B "\-on M" |
25 |
+ |
][ |
26 |
|
.B \-tC |
27 |
|
][ |
28 |
|
.B \-N |
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. |
130 |
|
.PP |
112 |
– |
At least one set of totals is produced for each input file. |
131 |
|
If no files are given, the standard input is read. |
114 |
– |
If a file contains any blank lines, then the total is reported |
115 |
– |
at that point as if it constituted the end of file, and the tallies |
116 |
– |
are reset. |
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), neaten(1), rcalc(1), rlam(1), tabfunc(1) |
150 |
> |
cnt(1), neaten(1), rcalc(1), rcollate(1), rlam(1), tabfunc(1) |