Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
1,765,027,338 visitors served.
forum mailing list For webmasters
?
New: Language forums
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

DOS Sort

    0.01 sec.

DOS Sort

An external command that sorts a text file or Dir list into alphabetical order. Lines in the text files must be uniform and columns (fields) must line up. The following example sorts the text file ABC (starting at column 1), creating ABC2. The < means "input from," and the > means "output to."

              sort < abc > abc2


Assuming that names and addresses exist in a text file called "friends" and that the city begins in character position 60, the following examples create a new file in city sequence. The /+ switch indicates that the city begins in column 60.
  sort /+60 < friends > friends2      a-z order
  sort /+60 /r < friends > friends2   z-a order


To sort the file and print it without saving the results, type:
       sort /+60 < friends > prn


To display a sorted Dir list, type:

                dir | sort


You can sort Dir lists by file characteristics. Use the /+ switch to begin the sort on other than column one of the line:
      dir | sort /+10   by extension
      dir | sort /+14   by file size
      dir | sort /+23   by month
      dir | sort /+29   by year


To write the sorted Dir list to a disk file, type:
     dir | sort > xyz   create new XYZ file
     dir | sort >> xyz  add to existing XYZ file


To append the current sorted directory list to the end of a file called XYZ, type:
              dir | sort >> xyz


Note!
As of DOS 5, additional sorting options for Dir are provided (see DOS Dir).



How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Email
Feedback
? Mentioned in
 
Encyclopedia browser? ? Full browser
 
 
Encyclopedia
?

Disclaimer | Privacy policy | Feedback | Copyright © 2009 Farlex, Inc.
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. Terms of Use.