Is there a way to sort case insensitively in Notepad++ 64 bit?

Viewed 225

To start: Yes I'm aware of this answer from over 6 years ago, but none of the answers would work inside of notepad++ x64 and I'm hoping that a plugin has came along that I have missed.

Things I've looked at and ruled out:

  1. Using TextFX - Not available for 64 bit (and a bit overkill for just case insensitive sorting, but that's not nearly as important)
  2. The builtin sort in Notepad++ - Case sensitive
  3. Save the file and then run it through sort - This technically works, but requires saving and leaving Notepad++
1 Answers

Takes three editing steps. Use a regular expression to modify each line to have a lower case version of the original, a marker string, then the original line. Sort the lines. Remove the lower case text and the marker.

In more detail:

  1. Choose a marker, a character or text that does not occur anywhere in the text to be sorted. For this example I will use <<>>.
  2. Do a regular expression search and replace changing ^(.*)$ to \L\1\E<<>>\1. The \L\1 inserts a lower case copy of the captured text. The \E stops the \L, the <<>>\1 inserts the marker and the original text.
  3. Perform a sort lines lexicographically ascending.
  4. Do a regular expression search and replace changing ^.*<<>> to the empty string, to leave just the original text.

For a clearer explanation of this technique see also this answer.

Related