


     Sort (V1.3, 2.x, 3.x in C:)    


     NAME
          Sort - Sort a file.

     SYNOPSIS
          1.3:
          Sort [From fromname] [To toname] [COLSTART n]

          2.x/3.x:
          Sort [From fromname] [To toname] [COLSTART n] [CASE]
               [Numeric]

     DESCRIPTION
            Performs a sort according to the first ASCII value of 
        the beginning characters of an AmigaDOS text file. 
        AmigaDOS treat a string of characters that ends with a 
        linefeed as a single line. Sort will compare each of 
        these lines with each other.

            Numbers will always come before letters. Lines will 
        be sorted in ascending order with the 'lower' number or 
        character first and the 'higher characters last (eg 
        1,2,3.....x,y,z). 

            Under 1.3 the sort is Case sensitive with capital 
        letters being listed before lower case letters. In all 
        versions 2.x and above there is no case sensitivity.

            1.3's sort is not very fast especially on long files. 
        If you have more than 200 lines then you must increase 
        the Stack size. If Sort fails, and you have 1.3, then 
        increase you stack size and you may improve your 
        performance.

            If you omit the From argument from Sort, it reads 
        from its standard input, which allows it to be used in 
        pipelines.

     KEYWORDS
          FROM
            The AmigaDOS file you whose contents you will sort. 
        If the fromname is the first argument in the command 
        labels then it is optional.

          TO
            The AmigaDOS file or device which the sorted lines 
        from fromname will be sent. If you use the same name as 
        fromname Sort will not work. If the toname is the second 
        argument in the command labels then it is optional.
        
          COLSTART n
            This takes a numeric argument which gives the 
        starting column for the sort. All entries to the left of 
        this column will not be considered in the final 
        arrangement.

          CASE
            2.X/3.X ONLY: If this option is used, the sort will 
        be case sensitive. In other words, upper case letter will 
        be sorted before lower case ones.


          NUMERIC
            With this keyword is specified all lines are looked 
        at as numbers. Lines that start with letters are assigned 
        the number zero. If both CASE and NUMERIC are used 
        simultaneously then CASE is ignored.  


            EXAMPLE
            1. To get a listing of all files sorted by time 
        (i.e., from the earliest to the latest).

          list >listfile
          sort listfile colstart 41

          or using pipes: list | sort colstart 41



            2. Sort the contents of your Address Book to a file 
        called Sorted Addresses:

          SORT "Address Book" "Sorted Addresses"



            3. To print out a sorted Address Book file in the 
        Work:People directory:

          SORT "Work:People/Address Book" PRT:


     


 
