I have a plain text file with content like this:
prežrať/RN
prežrieť/Z
prežrúc/zZ
prežuť/c
...
Q: How can I remove all strings after /
symbol in every row in Notepad++?
Desired output:
prežrať
prežrieť
prežrúc
prežuť
...
I am doing this with Find-and-Replace for every different string after /
, but there are too many combinations.
Ctrl-F2 on the line you wish to keep. This bookmarks the current line (you will see a blue circle at start of line). Then Use the “remove unmarked lines” which is under “Search” main menu, then “Bookmark” item. With “normal” size files, those work find, followed by DELETE or BACKSPACE to delete them.
If you want to delete all the text after a character or string (to the right) in Notepad++ you would need to make use of regex. So, simply add . * to delete all characters after the string or character on each that you want to delete from a line.
Search for: /.*
, replace with nothing.
The character /
matches just /
. .
, however, matches any character except newlines, so .*
will match a sequence of characters up until the first newline. You can find a demonstration here: http://regex101.com/r/kT0uE3.
If you want to remove characters only after the last on the line /
, you should use the regex /[^/]*$
. You can find an explanation and demonstration here: https://regex101.com/r/sZ6kP7/74.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With