Delete lines matching string
Hi, what is the process for deleting all lines matching a string? Here's what I tried,
Find Text, [enter string], Select All [all matches are now highlighted] Edit > Lines > Delete Line
This deletes only the final line containing a match. Is there a Select All Lines/Select Highlighted Lines option? Thanks
- On "Find Text", check "Bookmark matched line", then "Find All".
- Edit -> Bookmarks -> Select All, then press Delete key.
Thank you for the quick reply, I would never have discovered that. I was expecting a Select Highlighted Lines option somewhere then to simply hit Delete.
For reference, here's the process in Sublime Text.
- Find Text, [enter string], Select All
- Expand Selection to Line (Ctrl+L)
- Delete
Expand Selection to Line (Ctrl+L)
Here is "Select Lines (Expand Selection)", but it currently only handles main selection.
I think on the Find/Replace dialog box you could have a small droplist button of less-used actions, which could include this as well as its converse, Delete lines not containing, and maybe Select All might also go on it. When choosing the action from the droplist it executes it much as clicking a button would.