home *** CD-ROM | disk | FTP | other *** search
- SORT
-
- Alphabetically sorts the lines of a file.
-
- Format
-
- SORT [FROM] <file | pattern> [TO] <filename> [COLSTART <n>] [CASE] [NUMERIC]
-
- Template
-
- FROM/A,TO/A,COLSTART/K,CASE/S,NUMERIC/S
-
- Location
-
- C:
-
- SORT sorts the FROM file alphabetically, line-by-line, sending the sorted
- results to the TO file. SORT assumes the file is a normal text file in which
- lines are separated by line feeds. SORT normally disregards case. If the CASE
- switch is given, upper-cased items are output first.
-
- The COLSTART keyword specifies the character column at which the comparison
- begins. SORT starts comparing the lines from that point, wrapping around to
- the beginning of the line if the compared lines match to the end.
-
- When the NUMERIC option is specified, the lines are interpreted as numbers
- from the first column reading to the right, stopping at the first non-numeric
- character. Lines not beginning with numbers are treated as 0. The lines are
- output in numerical order. CASE is ignored when NUMERIC is specified.
-
- Example:
-
- 1> SORT DF0:Glossary TO DF0:Glossary.alpha
-
- sorts the lines in the Glossary file, arranges them alphabetically, and
- outputs them to a next file called Glossary.alpha. The case of the words is
- disregarded.
-
- For more examples using the SORT command, see Chapter 8.
-