Removing lines if contains X,X1,X2,X3
Ivica Orlić last edited by
I have like 30 words which i want to delete, but its really annoying when i need mark 1 by 1 word or letter then delete it. Is there something where i can paste example if line contains:
To delete all lines who contains this letter above?
Scott Sumner last edited by
There are probably better ways to do it, but I think this will accomplish the goal:
Invoke the Find dialog box and set it up this way:
abcwith your list of characters
Replace with: <-- make sure this is empty
This regular expression will match the start-of-line, it will then assert that one of the characters from the set is on the line, then it will match out to the end of the line including the line-ending character(s). Once it has such a match, the replace operation replaces the entire thing with nothing since the replace-with box is empty, effectively removing the line.
John Bowman last edited by
A way without regular expressions you could bookmark each of the lines (use the mark tab on the find files dialog), then from the drop down menus use Search > Bookmark > Removed bookmarked lines.