It may be easier to import the file into a word processor or database package and sort it there. In Microsoft Word, you can go to the Table menu, choose Sort, and then sort by paragraphs, assuming each entry is read as a separte line.
In Access, you can import a text file, assign a primary key, and the data will be automatically sorted.
If either of these solutions sounds workable for you, I can provide more instructions.