Macro for
EmEditor (my favourite text editor) to sort lines according to length
Save the macro of your choice below in a txt file in
My Macros folder (found in
My Documents). Rename the file to
sort.jsee (or use the attached after you unzip it).
First select the text. Then run any of these macros:
Sort the selected text from long to short
document.selection.text = ((document.selection.text.split("\n")).sort(function(a,b){return b.length-a.length})).join('\n');
Sort the selected text from short to long
document.selection.text = ((document.selection.text.split("\n")).sort(function(a,b){return a.length-b.length})).join('\n');
This was tested on an 80 MB file with maximum line length of 80,000 characters and it took a couple of seconds to run.