KOMPX.COM or COMPMISCELLANEA.COM   

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

  1. SORT.exe ss64.com/nt/sort.html
  2. sort learn.microsoft.com/en-us/windows-server/administration/windows-commands/sort

Operating systems

More