TAND v2.00 - intersect two data tables |
Revised 2-Jan-99. Copyright (c) 1996-99 by Rune Berg. TextTools Freeware. |
Usage | Description | Example | Options | Limitations | Return Codes | Version History | tt_r6
Usage | Top | Next |
tand [log logfile] [options] [infile1] and infile2 [to outfile]
Description | Top | Previous | Next |
tand prints, to outfile, all rows in infile2 that also appear in infile1; i.e. the intersection of the tables in infile1 and infile2.
infile1 and infile2 are ASCII text files. tand sees each input line as a row of (by default, but see -i and -a options) whitespace-separated fields; this is described in more detail in the documentation for tcols.
tand does not print duplicate rows.
tand ignores empty (whitespace only) input lines.
tand compares fields the same way as trows does.
If you don't specify infile1, 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 infile1 in memory while processing infile2, so you may want to specify the smaller input file first (i.e. as infile1).
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 infile1 by character C
(except \). Use \t to form a tab. |
-aC | Separate fields in infile2 by character C
(except \). Use \t to form a tab. |
-oS | Separate output fields by string S, instead
of the default tab character. Use \t to form a tab. |
-fppN | Use floating-point precision N (0..15, default 6) decimal digits for comparisons. See separate discussion on floating point numbers for more details. |
-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 infile1 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 command line arguments |
104 | Error opening file |
105 | I/O error |
106 | Capacity overrun |
107 | File name clash |
Version History | Top | Previous |
These are the released versions:
Version | Date | Changes |
---|---|---|
1.02 | 25-Feb-96 | n/a |
1.10 | 25-Sep-96 | * Very minor changes. |
1.20 | 8-Mar-97 | * Available as Win32 version. * Removed options -r and -c. * Change: rows printed are now taken from second input file. * Bug-fix: No longer prints duplicate rows from second input file. |
1.30 | 13-Jul-97 | * Proper return codes. |
2.00 | 2-jan-99 | * Field comparison now supports floating-point numbers. * Win32 version has increased max. input line length / fields per line. * Win32 version now prints coloured response texts. |
End of document |