How to remove duplicate words in Notepad++

Step 1: Opening the document in Notepad++
- Launch Notepad++.
- Open the file where you want to remove duplicate words. To do this, select File > Open and specify the path to your file.
Step 2: Opening the replace window
- Go to the Search menu.
- Select the Replace... option to open the replace window.
Step 3: Using regular expressions
- In the replace window, check Match case if you need case sensitivity.
- Check Regular expression at the bottom of the window to enable regular expressions.
Step 4: Entering the search pattern
In the Find field, enter the following regular expression:
\b(\w+)\s+\1\b
- \b denotes a word boundary.
- (\w+) denotes any sequence of letters and numbers (word), captured in a group.
- \s+ denotes one or more spaces.
- \1 refers to the first captured group (repeating word).
Step 5: Replacing duplicate words
- In the Replace with field, enter $1. This means you want to replace duplicate words with the first occurrence.
- Click the Replace All button to replace all duplicate words in the document.
Now your document is cleaned of duplicate words.