1

is there also a way to delete every line that doesn't have a specific character in it? For example delete every line that doesn't include the character @:

1234 (delete)
5678 (delete)
@901 (keep)
2345 (delete)
12@5 (keep)
6789 (delete)

I think you get the idea, would be very helpful if someone could tell me :)

AdrianHHH
  • 13,492
  • 16
  • 50
  • 87
semr
  • 13
  • 3
  • 1
    You have the answer here : http://stackoverflow.com/questions/5876296/regex-remove-lines-containing – Harsha W May 16 '17 at 05:44
  • 1
    Possible duplicate of [How to delete specific lines on Notepad++?](http://stackoverflow.com/questions/918158/how-to-delete-specific-lines-on-notepad) . Note that there are several other useful commands on the **Search** => **Bookmark** menu including **Remove unmarked lines**. – AdrianHHH May 16 '17 at 08:28
  • Possible duplicate of [Regex: Remove lines containing](http://stackoverflow.com/questions/5876296/regex-remove-lines-containing) – Picard May 16 '17 at 08:42

1 Answers1

0

You have to use regular expressions to mass delete such strings.

1) Ctrl+H for find and replace

2) in the find tab, enter the regex [^@][0-9][^@]\w+

3) in the replace tab just give spaces

4) click replace all

Note:- you have to select regular expression search mode while doing this. Please find image below, enter image description here

Gowtham Shiva
  • 3,802
  • 2
  • 11
  • 27