For randomly ordered lines like the following.

Unsorted Line in Notepad++
We can use Notepad++ to sort them into an ordered way, in function menu, we click Edit > Line Operations.

Notepad++ - Edit - Line Operations - Sort Lines
After sorted, the lines look like this:

Sorted Line in Notepad++