Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? AmigaOne
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

SORT AmigaDOS
Purpose: Alphabetically sorts the lines of a file.
Format: SORT [FROM] <filename> | <pattern> [TO] <filename> [COLSTART <n>] [CASE] [NUMERIC] [DESCENDING]
Template: FROM/A, TO/A, COLSTART/K, CASE/S, NUMERIC/S, DESCENDING/S
Path: C:
SORT sorts the FROM file alphabetically into ascending sequence, line by line, sending the sorted result 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 the NUMERIC option is specified.

When the DESCENDING option is specified, the sort order is reversed.

Example:

3.OS4:> SORT Glossary TO Glossary.alpha
sorts the lines in the 'Glossary' file, arranges then alphabetically, and outputs them to a new file called 'Glossary.alpha'. The case of the words is disregarded.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.