Page 1 of 1

How to delete whole line starting with "xxx" ?

Posted: Wed Oct 01, 2008 10:08 am
by imsaurabh
How to delelete a whole line starting with a word e.g i have a text =>

abcdef ghij 1234 567
abcdef ghij 1111 222 wssd
wqywtqy hjhjh 8989
sashjah iusiasu 98989

I want to remove all line starting with abcdef
Output should be :

wqywtqy hjhjh 8989
sashjah iusiasu 98989


these two line should be removed
abcdef ghij 1234 567
abcdef ghij 1111 222 wssd



Kindly frogive me if this has already been posted .... :oops:

Posted: Wed Oct 01, 2008 11:07 am
by ACRobin
Use the "Find" dialogue and search for lines starting with "abcdef" - in the "Find" dialogue the is a button "Mark All" use that and it will "Bookmark" all lines matching the find criteria.

A regular expression to anchor your search to the beginning of each line is needed - there are details in the help on that, and you can get help on that in the "Regular Expression" part of the forum.

Then to delete all the marked lines go to the menu item "Edit" - > "Delete", you will see an option to delete all marked lines.

Posted: Wed Oct 01, 2008 11:34 am
by ben_josephs
You don't need to use bookmarks to do this.
Find what: ^abcdef.*\n
Replace with: [nothing]

[X] Regular expression

Replace All