问题
How can you do a case-insensitive sort in recent versions of Notepad++ (i.e. >= 6.5)?.
I'm aware of the old way of using TextFX, however Notepad++ now has the built-in "Line Operations", but these seem to be case sensitive.
回答1:
You can still use the TextFX Characters plugin in recent versions of Notepad++ (tested under version 6.5.5):
- Click
Plugins/Plugin Manager
/Show Plugin Manager
- Under Available find
TextFX Characters
- Click Install
- Select rows to be sorted.
- Click
TextFX/TextFX Tools
- Check or uncheck
Sort ascending
Sort lines case insensitive
回答2:
Since N++ is trying to sort a text file, you can just save the file
and use the SORT
command in a DOS window;
then just re-open the sorted file with N++ .
For help with the SORT
command in a DOS window,
type either of the following:SORT /?|MORE
HELP SORT|MORE
2019Feb25 (JoeG314)
回答3:
Case insensitive sorting is not supported in Notepad++. TextFX is not supported in recent x64 Notepad++, but will work for this in other versions.
Here's a convoluted workaround for most cases:
- Load and enable the "elastic tabstops" plugin, if necessary.
- Add a tab character at the end of each line (search/replace).
- Copy the file as a column (Alt-drag).
- Paste the column at the beginning of the file (duplicating each line horizontally, separated by a tab).
- Select the left column, and from the Edit menu, Convert Case to, lowercase.
- Do a Lexicographic Sort from the Edit menu.
- Select and delete the left column.
- Delete leftover tab characters.
Alternatively, you can copy and paste into something like Excel, sort, and copy back.
来源:https://stackoverflow.com/questions/23606753/sort-case-insensitive-in-recent-versions-of-notepad