Sort Ü
ßßßßß
Reads input, sorts data, and writes the results to the screen, a file,
or another device. Sort acts as a filter, reading characters in a
specified column and rearranging them in ascending or descending order.
Syntax: SORT [/R] [/+n] [<] [drive1:][path1]filename1 [> [drive2:][path2]
filename2]
drive1:[path1]filename1
Specifies the location and name of the file whose data you want
to sort.
drive2:[path2]filename2
Specifies the location and name of a file in which the sorted
output is to be sorted.
command
Specifies a command whose output is the data you want to sort.
/R Reverses the sorting order; sorts from Z to A, and from 9 to 0.
/+n Sorts the file according to the character in column n. If you
do not use this switch, the sort command sorts data according
to the characters in column 1.
Using redirection symbols with sort
Use the pipe (|) or the less-than sign (<) to direct data through sort
from command or filename. To display information one screen at a time
or direct it to a file, specify the more command or a filename. Use
the greater-than sign (>) to direct the sorted output to a file.
Limits on size
The sort command can only handle files as large as 64k.
Examples:
The following command reads the file BUGS.TXT, sorts it in reverse order,
and displays it on your screen:
sort /r < bugs.txt
See Also:
More