Sort case insensitive in recent versions of Notepad++

蓝咒 提交于 2021-01-27 02:49:25

问题


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:

  1. Load and enable the "elastic tabstops" plugin, if necessary.
  2. Add a tab character at the end of each line (search/replace).
  3. Copy the file as a column (Alt-drag).
  4. Paste the column at the beginning of the file (duplicating each line horizontally, separated by a tab).
  5. Select the left column, and from the Edit menu, Convert Case to, lowercase.
  6. Do a Lexicographic Sort from the Edit menu.
  7. Select and delete the left column.
  8. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!