Commodore PC Ms-Dos 3.2 User's Manual page 160

Table of Contents

Advertisement

88 MS-DOS User's Reference
Sort
The Sort switches
Sort
Purpose:
Reads input, sorts the data, then writes the sorted data to your
terminal screen, to a file, or to another device.
Syntax:
sort [drive:]\pathname][/r][/+ n]
Comments:
The sort command lets you alphabetize a file according to the
character in a certain column. You specify the file by the drive:
and pathname options. The two other sort options, the It and
l + n switches, are described as follows:
It
Reverses the sort, that is, sorts from Z to A.
/ + «
Sorts the file according to the character in column w,
where n is some number. If you do not specify this
switch, the sort command sorts the file according to
the character in the first column.
Note
Sort does not distinguish between uppercase and lower
case letters.
U
u
Sorting a file
Examples:
The following command reads the file expenses, txt, sorts it in
reverse order, and writes the output to a file named budget, txt:
sort
/r
expenses.txt
budget.txt
The following command pipes the output of the dir command to
the sort filter. This filter sorts the directory listing starting with
column 14 (the column in the directory listing that contains the
file size) and sends the output to the screen. The result is a direc
tory, sorted by file size:
dir
!
sort
/ + 14
The following command does the same thing as the previous one,
except that the more filter gives you a chance to read the sorted
directory one screenful at a time:
dir
sort
/ + 1 4
1
more

Advertisement

Table of Contents
loading

Table of Contents