TSUB v2.10 - subtraction of two data tables |
Documentation revised 21 Oct 00 - Copyright (c) 1996-2000 by Rune Berg. TextTools Freeware. |
Contents:
Usage | Top || Next |
tsub [log logfile] [options] [infile] and infile2 [to outfile]
See Understanding The Usage Section for details.
Description | Top || Previous || Next |
tsub prints, to outfile, all rows in infile that do not appear in infile2; i.e. infile 'minus' infile2.
infile and infile2 are ASCII text files. tsub sees each input line as a row of (by default, but see options) whitespace-separated fields; this is described in more detail in the documentation for tcols.
tsub compares rows field by field according to the following rules:
All printed rows are from infile, in the original order.
tsub ignores empty (whitespace only) input lines.
If you don't specify infile, tsub reads from standard input.
If you don't specify outfile, tsub writes to standard output.
If you don't specify logfile, tsub writes error messages to standard
error.
tsub holds the contents of infile2 in memory while processing infile.
Example | Top || Previous || Next |
Consider the file "scooby" which contains:
tom 100 mary 9 al 77 frank 17 peter 18
and the file "doo" which contains:
peter 18 paul 74 mary 9 frank 40
The command:
tsub scooby and doo
writes, to the screen, the rows that are unique to "doo":
tom 100 al 77 frank 17
Options | Top || Previous || Next |
tsub recognizes the following command line options:
Option | Function |
---|---|
-iC | Separate fields in infile by character C (except \). Use \t to form a tab. |
-csvi | Do CSV (comma separated values) style parsing of input fields from infile. Unless the -iC option is given, use a comma as the field separator. |
-aC | Separate fields in infile2 by character C (except \). Use \t to form a tab. |
-csva | Do CSV (comma separated values) style parsing of input fields from infile2. Unless the -aC option is given, use a comma as the field separator. |
-oS | Separate output fields by string S, instead of the default tab character. Use \t to form a tab, \\ to form a backslash. -o recognizes no other escaped characters. |
-csvo | Print output fields CSV (comma separated values) style. Unless the -oS option is given, use a comma as the field separator. |
-fppN | Use floating-point precision N (0..15, default 6) decimal digits for comparisons/output. See separate discussion on floating point numbers for more details. |
-r | Print a one-line report to standard error (or logfile, if given) after processing. This option has no effect if processing is aborted due to an error. |
-v | Print version banner and usage info to standard error (or logfile, if given), then exit. |
Limitations | Top || Previous || Next |
tsub runs out of memory if infile2 is too large.
See also TextTools General Features.
Return Codes | Top || Previous || Next |
tsub returns with one of the following codes ("error levels"):
Code | Meaning |
---|---|
0 | Success |
101 | Out of memory |
102 | Incorrect/missing command line arguments |
104 | Error opening file |
105 | I/O Error |
106 | Capacity overrun |
107 | File name clash |
For more details, see TextTools General Features.
Version History | Top || Previous |
These are the released versions of tsub:
Version | Date | Changes |
---|---|---|
2.10 | 21-Oct-00 | (Similar in capability to tand 2.10) |
End of document |