Use EditSort to rearrange the order of current session lines according to the characters in specified columns for a specified group of lines.
EditSort may also be entered as Sort.
The group of lines can be specified by pre-selecting the lines (see Selection) or by using the FCT operand. If neither a pre-selection or FCT operand is provided, the group of lines consists solely of the current line.
Required Operands
KEY specifies the sort key. Sorting can be based upon up to six column ranges, so long as the combined key length does not exceed 253. If multiple column ranges are specified, column ranges are separated from each other with a comma and the entire KEY is enclosed within apostrophes. Each column range specification is composed of up to three parts, separated by dashes.
the base column number (from 1 through the session maximum line width).
the limit column number (from 1 through the session maximum line width).
the sort order (A=ascending, D=descending).
The base and limit column numbers are always specified. The sort order need be specified only if descending order is desired.
The following are all valid sort keys.
1-12
1-12-A
1-12-D
'1-12,40-42'
'1-12-D,40-42-A'
Optional Operands
FCT specifies the number of lines to sort. If FCT is specified as an asterisk (*), all of the lines through the end of the session will be sorted.
CASE specifies whether upper/lower case should be considered when determining sort order. If specified as U[pper] or I[gnore], case is ignored ('the' is considered equal to 'THE'). If specified as M[ixed] or Ma[tch], case is considered.
Default: Mixed.
Order is determined by the ASCII collating sequence, adjusted for the CASE option above. Most special characters precede all digits, that proceed all upper case letters, that precede all lower case letters.
Return Codes
OK Successful.
Examples
Sort lines starting at the current line and proceeding through to the last line of the session based upon the text in columns 1 to 14:
=> sort 1-14 *