You can use the 32-bit version of Notepad++ with the TextFX plugin to quickly remove duplicates, remove blank lines, and sort data - in one operation! This is a fast and easy way to get the results you want in just a few seconds. And as with any kind of automation: the more data you work with, the more time you save 🤓
The quick version:
- Install the 32-bit version of Notepad++
- Install the TextFX plugin (this is not available in the 64-bit version of Notepad++)
- Enable Sort outputs only UNIQUE
- Click Sort lines case [in]sensitive
Remove Duplicates, Remove Blank Lines, and Sort Data in One Operation
In this example, we have a list of data types used in a SQL Server table. We want to find all the unique data types used, and also sort them alphabetically.
1. Click TextFX → TextFX Tools → Enable Sort outputs only UNIQUE (at column) lines:
2. In the Notepad++ window, paste the text that you want to remove duplicates and blank lines from. In this example, we have 500 lines, and half of them are blank:
3. Select all the text, click TextFX → TextFX Tools → Sort lines case sensitive (at column) or Sort lines case insensitive (at column):
4. Tadaaa! 🥳 We have now removed duplicates and blank lines, and the data has been sorted alphabetically. In this example, we ended up with only 15 lines:
In the 32-bit version of Notepad++, you can use the TextFX plugin to quickly remove duplicates, remove blank lines, and sort data - in one operation! First, make sure that you have the Sort outputs only UNIQUE option enabled. Then, use the Sort lines case [in]sensitive feature.
That’s it! This is a very handy feature, but it is somewhat hidden away in the menu. Once you find it, however, it can save you a lot of time 🤓
About the Author
Cathrine Wilhelmsen is a Microsoft Data Platform MVP, BimlHero Certified Expert, international speaker, author, blogger, and chronic volunteer. She loves data and coding, as well as teaching and sharing knowledge - oh, and sci-fi, chocolate, coffee, and cats 🤓