How to remove lines without a period at the end in Notepad++
- Open Notepad++ and open the file in which you need to remove lines without a period at the end.
- Press Ctrl+F to open the find dialog box.
- Go to the Replace tab.
- Enable the Regular expression option at the bottom of the window.
Now you need to use a regular expression to find lines without a period at the end. In the Find field, enter the following expression:
^(?!.*\.$).*
Explanation of this expression:
- ^ — signifies the beginning of a line.
- (?!.*\.$) — a negative lookahead assertion ensuring the line does not end with a period.
- .* — matches any characters in the line.
Leave the Replace with: field empty.
Click Replace All to remove all lines that do not end with a period.
After performing the replacement, all lines without a period at the end will be removed from your file.