Deletion of repeated words using Notepad++

Asked

Viewed 13,641 times

8

It is possible to delete repeated words in a text file using Notepad++?

2 answers

8


If your Notepad++ has plugin Textfx (newer versions usually come with it. Alternatively you can easily add it using the Plugin manager), and the words are in separate lines, you can do this way:

  1. Select the desired text (or give Control + to to select all), and sort the words with these two options:

    Sort ascending ( put in ascending order )

    and

    Sort outputs only UNIQUE ( Order only outings with UNIQUE / unique )

  2. Once the two options are selected, click on one of the two options just above:

    Sort Lines case sensitive ( if you want to differentiate between upper and lower case )

    OR

    Sort Lines case insensitive (if it is to eliminate repeated cases independent of the Casing ).


screenshot Source: Notepad++ remove Uplicates, remove Blank Lines and Sort data in one Operation

Just don’t forget to turn UNIQUE off after doing this if you’re going to use Textfx to sort something else ;)

  • Thank you so much! Perfect!

2

There is the tool to find and also replace words that can somehow do this.

Clicking Control + F, it will open a window with several options:

Find | Replace | Find in Files | Mark

Clicking on the tab Replace, you can add the word you want to find and what you want to replace, if it is by another word or leave blank if you want it to be removed. You can replace one or all words in the current document, or in all open documents/tabs in Notepad++ as you can see in the button options on the right side.

inserir a descrição da imagem aqui


Update

I noticed leaving the option "Replace with" blank, it will replace with a blank as a final result.
To solve this problem just make a new replacement but this time on "Find what" put 2 spaces and the "Replace with" we will only put a space to fix this problem.

  • 1

    @Chun Thank you so much for the tbm tip!

  • this answer does not answer the question asked

  • @Your comment intrigues me. Could you tell me from your perspective how my answer does not answer to the question made by OP? I’m just curious.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.