How to delete all characters after a comma in Notepad++
Open the file you want to edit in Notepad++. To do this, click File → Open and select the desired file.
- Click Search → Replace or use the
Ctrl + Hkeyboard shortcut. - In the opened window, select the Replace tab.
- In the Find field, enter the following regular expression:
,.* - Leave the Replace with field empty.
- Make sure the Regular expression option is selected at the bottom of the window.
- Click Replace All to delete all characters after the comma.
Explanation of the regular expression
The regular expression ,.* consists of two parts:
,– a comma. This is the character we are looking for..*– any character (.) in any quantity from zero to infinity (*). Thus, this expression finds the comma and all characters after it.
Now you know how to delete all characters after a comma in Notepad++. This method can be adapted to delete characters after other signs or words by simply changing the regular expression.