TSORT v2.00 - field oriented sorting
Revised 2-Jan-99. Copyright (c) 1996-99 by Rune Berg. TextTools Freeware.

Usage | Description | Example | Options | Limitations | Return Codes | Version History | tt_r6


UsageTop | Next

tsort [log logfile] [options] [from infile] [to outfile] expr [...]


DescriptionTop | Previous | Next

tsort sorts infile on the results of the given expression(s), and writes the sorted data to outfile. Expressions are as for tcols.

infile must be an ASCII text file. tsort sees each input line as a row of (by default) whitespace-separated fields; see tcols for more info.

tsort ignores empty (whitespace only) input lines.

tsort compares data the same way as trows does.

tsort retains the relative order of lines for which the expressions evaluate the same.

The output lines are identical to the input lines. tsort only changes their order.

If you don't specify infile, tsort reads from standard input.
If you don't specify outfile, tsort writes to standard output.
If you don't specify logfile, tsort writes error messages to standard error.


ExampleTop | Previous | Next

Consider the file "records.txt":

The command:

sorts the records on band/artist name (stripped of surrounding double quotes) and further on year of release, printing:


OptionsTop | Previous | Next

tsort recognizes the following command line options:


LimitationsTop | Previous | Next

tsort has the same limitations as tcols.

tsort runs out of memory when infile, or the expressions evaluated thereof, are too large.


Return CodesTop | Previous | Next

tsort returns with one of the following codes ("error levels"):


Version HistoryTop | Previous

These are the released versions:

End of document