Sorting the contents of a file alphabetically (Windows Command Prompt)
Sorting the contents of a file alphabetically by SORT command in Windows Command Prompt. Case-insensitive:
SORT "file.txt" /O "file.txt"
Note. There is /C or /CASE_SENSITIVE switch, but it depends on the locale and is undocumented in Windows 7 and above. So some ASCII characters may be sorted differently and some Unicode characters may not sort correctly at all.
Links
- SORT.exe ss64.com/nt/sort.html
- sort learn.microsoft.com/en-us/windows-server/administration/windows-commands/sort
Operating systems
- Windows
More
- Copy the contents of one file to another (Windows Command Prompt)
- Count the number of lines in a file in Windows Command Prompt
- Create an empty file from command line (Windows)
- Display the contents of a file in DOS or Windows Console
- Remove duplicate lines in a file (Windows Command Prompt)
- Remove leading and trailing spaces from text (Windows Command Prompt)