There is a different solution with Notepad++ which doesn't require the extra plugin.
I used this input and I assumed that there aren't any # in the input. You could just use a different character for separating your sorting item from your original input.
123&name=Alpha&somethingelse
456&name=Gamma&differentstuff
789&name=Beta&otherstuff
Use a regular expression search & replace to copy the part you want to sort to the front of the line. Make sure to enable regular expressions and use
Search: (.*)&name=(.*?)&(.*)
Replace: \2#\1&name=\2&\3
Result:
Alpha#123&name=Alpha&somethingelse
Gamma#456&name=Gamma&differentstuff
Beta#789&name=Beta&otherstuff
- Use the sort lines feature.
Result:
Alpha#123&name=Alpha&somethingelse
Beta#789&name=Beta&otherstuff
Gamma#456&name=Gamma&differentstuff
Use another regular expression to undo the changes from step 1.
Search: (.*)#(.*)
Replace: \2
Result:
123&name=Alpha&somethingelse
789&name=Beta&otherstuff
456&name=Gamma&differentstuff
Thanks for the quick answers, managed to get it sorted through Notepad++ – Syztemlord – 2015-07-23T15:18:05.777