Microsoft DOS SCANDISKSETSETVERSETVER.EXESHARESHELLSHIFTSIZERSMARTDRVSMARTDRV.EXE Draft for Information Only
ContentMS DOS Command: SORT.EXE
MS DOS Command: SORT.EXEReference from Microsoft MS-DOS cmd help DescriptionReads input, sorts data, and writes the results to the screen, a file, or another device. SORT acts as a filter, reading characters in a specified column and rearranging them in ascending or descending order. SyntaxSORT [/R] [/+n] [<] [drive1:][path1]filename1 [> [drive2:][path2]filename2]
[command |] SORT [/R] [/+n] [> [drive2:][path2]filename2]
Parameters
Switches
Related CommandFor information about displaying information one screen at a time, see the MORE command. RemarksSpecifying a sourceUnless you specify the command or filename parameter, SORT acts as a filter and takes input from the MS-DOS standard input (usually from the keyboard, from a pipe, or from a file). Using redirection symbols with SORTYou can use the pipe (|) or the less-than sign (<) to direct data through the SORT command from command or filename. If you want to display the information one screen at a time or direct the information to a file, you can also specify the MORE command or a filename. You can use the greater-than sign (>) to direct the sorted output to a file. Before using a pipe for redirection, you should set the TEMP environment variable in your AUTOEXEC.BAT file. Collating sequenceThe SORT program uses the collating-sequence table corresponding to the country code and code-page settings. Characters greater than ASCII code 127 are sorted based on information in the COUNTRY.SYS file or in an alternate file specified by the COUNTRY command in your CONFIG.SYS file. Uppercase vs. lowercaseSORT does not distinguish between uppercase and lowercase letters. Limits on file sizeThe SORT command can handle files as large as 64K. ExamplesThe following command reads the file EXPENSES.TXT, sorts it in reverse order, and displays it on your screen: sort /r < expenses.txt Suppose you want to search a large file named MAILLST.TXT for the text "Jones", and suppose you want to sort the results of the search. To do this, use the pipe (|) to direct the output of a FIND command to the SORT command, as shown in the following example: find "jones" maillst.txt | sort The command produces a sorted list of lines that contain the specified text. To sort keyboard input and display the results alphabetically on the screen, you can first use the SORT command with no parameters, as the following example shows: SORT Then type the text you want sorted, pressing ENTER at the end of each line. When you have finished typing text, press CTRL+Z, and then press ENTER. The SORT command displays the text you typed, sorted alphabetically. You could also redirect sorted keyboard input to a file. ©sideway ID: 110700262 Last Updated: 7/30/2011 Revision: 0 Latest Updated Links
![]() ![]() ![]() ![]() ![]() |
![]() Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Travel 18 Reference 79 Computer Hardware 254 Software Application 213 Digitization 37 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 431 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2025 Sideway . All rights reserved Disclaimers last modified on 06 September 2019