I have lists of files that contain a few columns of data. It is not sorted the way I want from the output, so I'm manually hunting for where a line should be. Is there a way in Notepad++ to sort the lines alphabetically? If so, how?
Since Notepad++ 6.5.2 it is now natively possible to sort lines:
(Note that this answer was written before np++ 6.5.2 released.)
It seems that Notepad++ doesn't support sorting by default, but Notepad++ has many friends to do something like that for you which we call plugins.
- Download TextFX plugin for Notepad++ ( TextFX in SourceForge ) - go to the latest version and download the latest TextFX…bin.zip.
- Open the zip and extract NppTextFX.dll to (Program Files)\Notepad++\plugins folder.
- Restart Notepad++
- To do the sort, select lines to sort, go to TextFX on the main menu and select TextFX Tools - Sort lines.
Since you are using Notepad++, I assume you are using Windows. You have a few other options to sort large text file content alphabetically.
My personal favorite is PowerShell. You could use the Sort-Object cmdlet. The following command shows an example of how to use the cmdlet. We first read the content (Get-Content) of MyFile.txt, pass it to the Sort-Object cmdlet (Sort) and output the result into a new file (Out-File).
Get-Content MyFile.txt | Sort | Out-File MySortedFile.txt
Another option is to use the sort command in the Command Prompt.
sort MyFile.txt /o MySortedFile.txt
protected by Canadian Luke Sep 11 '18 at 21:06
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?