SORT
.-A-----. .-1-------. >>-SORT--+-*-------+--+-------+--+---------+------------------->< '-+-----+-' '-+---+-' +-fromcol-+ '-num-' '-D-' '-tocol---'
SORT sorts the lines from the current line on down.
Operands
- *
- specifies that all the lines from the current line to the end of the file are sorted.
- num
- specifies that the lines from the current line for the value of num are sorted.
- A
- specifies that the lines are sorted in ascending order. (This is the default.)
- D
- specifies that the lines are sorted in descending order.
- fromcol
- specifies that the lines are sorted on data beginning in this column. If you do not specify fromcol tocol, sorting begins at the first column.
- tocol
- specifies that the lines are sorted on data ending in this column.
Return codes
- 0
- Normal return
- 202
- Invalid operand
- 229
- Number out of range
Example
'SORT * A 5 10'
This example sorts all lines in the file from the current line down and is sorted on columns 5 to 10.
Note
If you sort a large number of lines, the sort will work very slowly.
