TAND v2.10 - intersect two data tables |
Documentation revised 21 Oct 00 - Copyright (c) 1996-2000 by Rune Berg. TextTools Freeware. |
Contents:
Usage | Top || Next |
tand [log logfile] [options] [infile] and infile2 [to outfile]
See Understanding The Usage Section for details.
Description | Top || Previous || Next |
tand prints, to outfile, all rows in infile2 that also appear in infile; i.e. the intersection of the tables in infile and infile2.
infile and infile2 are ASCII text files. tand 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.
tand compares rows field by field according to the following rules:
tand does not print duplicate rows from infile2.
tand ignores empty (whitespace only) input lines.
tand prints rows in their original relative order.
If you don't specify infile, tand reads from standard input.
If you don't specify outfile, tand writes to standard output.
If you don't specify logfile, tand writes error messages to standard
error.
tand holds infile in memory while processing infile2, so you may want to specify the smaller input file first (i.e. as infile).
Example | Top || Previous || Next |
Consider the file "scooby" which contains:
peter 18 paul 74 mary 9 frank 40
and the file "doo" which contains:
tom 100 mary 9 al 77 frank 17 peter 18
The command:
tand scooby and doo
writes, to the screen, the rows that are common to the two files:
mary 9 peter 18
Options | Top || Previous || Next |
tand 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 |
tand runs out of memory if infile is too large.
See also TextTools General Features.
Return Codes | Top || Previous || Next |
tand 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 tand:
Version | Date | Changes |
---|---|---|
1.02 | 25-Feb-96 | n/a |
1.10 | 25-Sep-96 | |
1.20 | 8-Mar-97 | |
1.30 | 13-Jul-97 | |
2.00 | 2-jan-99 | |
2.10 | 21-Oct-00 |
|
End of document |