Usage - Description - Example - Options - Limitations
tand [log logfile] [options] [infile1] and infile2 [to outfile]
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).
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
-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.
-v : Print version banner and usage info to standard error (or logfile, if given), then exit.
tand handles up to 100 fields per input line.
tand runs out of memory if infile1 is too large.