

How do I sort a text file alphabetically? How do I sort a text file?Īlthough there’s no straightforward way to sort a text file, we can achieve the same net result by doing the following: 1) Use the FileSystemObject to read the file into memory 2) Sort the file alphabetically in memory 3) Replace the existing contents of the file with the sorted data we have in memory. What you do is make a column block (Alt + Left-click, then drag) covering the lines you want sorted and have the left side of the block be in the first column you want the sort to be based upon. To sort the lowest number or the beginning of the alphabet first, select Ascending. The column or columns you selected become the defaulted row or rows in the sort by field(s). On the NotePad tab, select the row numbers of the rows you want to sort.
