If you use Windows and you need a powerful programmers editor, you should take a look at the popular Notepad++ (NPP) program.
One of my favorite features was the built-in line sorting that went missing in recent releases due to stability issues and lack of maintenance by the legacy TextFX plugin developers. Good news is that version 6.5.2 (December 2013) and newer feature built-in line sorting capabilities.
You can read more about the important line operations described in the official NPP documentation. In addition to the sorting feature, you might want to try out the remove empty lines option :-).