TUNIQ v2.00 - print lines that evaluate uniquely |
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 |
tuniq [log logfile] [options] [from infile] [to outfile] expr [...]
Description | Top | Previous | Next |
tuniq prints, to outfile, the lines in infile that evaluate uniquely on the given expression(s).
Expressions are as for tcols.
infile must be an ASCII text file. tuniq sees each input line as a row of (by default) whitespace-separated fields; see tcols for more info.
tuniq ignores empty (whitespace only) input lines.
The output lines are identical to the input lines.
tuniq compares data the same way as trows does.
If you don't specify infile, tuniq reads from standard input.
If you don't specify outfile, tuniq writes to standard output.
If you don't specify logfile, tuniq writes error messages to standard
error.
Example | Top | Previous | Next |
Consider the file "records.txt":
Band "The Band" 1969 LP "Violent Femmes" "Violent Femmes" 1983 LP "Violent Femmes" "Violent Femmes" 1983 CD Beatles Revolver 1966 CD Beatles "Rubber Soul" 1965 CD "Waits, Tom" Swordfishtrombones 1983 CD Band "Music From Big Pink" 1968 LP "Waits, Tom" Swordfishtrombones 1983 LP
The command:
tuniq from records.txt $1 $2 $3
prints the record list without CD/LP duplicates:
Band "The Band" 1969 LP "Violent Femmes" "Violent Femmes" 1983 LP Beatles Revolver 1966 CD Beatles "Rubber Soul" 1965 CD "Waits, Tom" Swordfishtrombones 1983 CD Band "Music From Big Pink" 1968 LP
Options | Top | Previous | Next |
tuniq recognizes the following command line options:
Option | Function |
---|---|
-iC | Separate input fields by character C (except \). Use \t to form a tab. |
-r | Print a one-line report after processing. |
-fppN | Use floating-point precision N (0..15, default 6) decimal digits for internal representation
and comparisons. See separate discussion on floating point numbers for more details. |
-he | Print summary of expression usage to standard output, then exit. |
-hfc | Print summary of character functions to standard output, then exit. |
-hfs | Print summary of string functions to standard output, then exit. |
-hfv | Print summary of conversion functions to standard output, then exit. |
-hfm | Print summary of maths functions to standard output, then exit. |
-hfx | Print summary of miscellanous functions to standard output, then exit. |
-hf name | Print summary of named function to standard output, then exit. |
-v | Print banner with version number to standard error (or logfile, if used), then exit. |
Limitations | Top | Previous | Next |
tuniq has the same limitations as tcols.
tuniq runs out of memory when infile, or the expressions evaluated thereof, are too large.
Return Codes | Top | Previous | Next |
tuniq 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 |
109 | Bad input data |
Version History | Top | Previous |
These are the released versions:
Version | Date | Changes |
---|---|---|
1.30 | 24-Sep-96 | n/a |
1.40 | 23-Feb-97 | * Increased capacity and speed. * Available in Win32 console mode version. |
1.50 | 12-Jul-97 | * Gives proper return codes. |
2.00 | 2-Jan-99 | * Supports floating point numbers. * New functions .cc & family: various forms of character replacement. * New functions .dc & family: various forms of character deletion. * Win32 version has increased max. input line length / fields per line. * Win32 version has coloured response texts. * New option -r : one-line report. * New options -hfc -hfs -hfv -hfm -hfx : these replace the -hf option. |
End of document |