The Computer Oracle

Sort text by value in Notepad++

Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn

--

Track title: CC G Dvoks String Quartet No 12 Ame 2

--

Chapters
00:00 Question
00:27 Accepted answer (Score 169)
00:46 Answer 2 (Score 49)
01:39 Answer 3 (Score 6)
02:45 Thank you

--

Full question
https://superuser.com/questions/724176/s...

Accepted answer links:
[Notepad++ 6.5.2]: http://notepad-plus-plus.org/news/notepa...

Answer 2 links:
[TextFX in SourceForge]: http://sourceforge.net/projects/npp-plug.../

Answer 3 links:
[Sort-Object cmdlet]: https://technet.microsoft.com/en-us/libr...
[image]: https://i.stack.imgur.com/iRlas.png
[sort command]: https://msdn.microsoft.com/en-us/library...
[image]: https://i.stack.imgur.com/Bdjtr.png
[miniwebtool.com]: http://miniwebtool.com
[sortlines.com]: https://sortlines.com

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#notepad++

#avk47



ACCEPTED ANSWER

Score 171


Since Notepad++ 6.5.2 it is now natively possible to sort lines:

Version v6.9.2 (as of 8/5/16)




ANSWER 2

Score 49


(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.

  1. Download TextFX plugin for Notepad++ ( TextFX in SourceForge ) - go to the latest version and download the latest TextFX…bin.zip.
  2. Open the zip and extract NppTextFX.dll to (Program Files)\Notepad++\plugins folder.
  3. Restart Notepad++
  4. To do the sort, select lines to sort, go to TextFX on the main menu and select TextFX Tools - Sort lines.



ANSWER 3

Score 6


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

enter image description here

Another option is to use the sort command in the Command Prompt.

sort MyFile.txt /o MySortedFile.txt

enter image description here

Finally, the last option is to use an online tool: miniwebtool.com or sortlines.com will do the job.