Page 1 of 1

Search for a word & replace the whole line

Posted: Tue Oct 16, 2007 7:52 pm
by maredzki
Hi,
I am trying to search for a word, i.e. ahoy and i have a several sequential text lines (seperated by cr). I would like to find the word that I am looking for and remove the whole line from the file.

I tried Batch Replace with the words and the "Replace with:" is empty but that only replaces the word itself.

How is that done?

Thanks!

Re: Search for a word & replace the whole line

Posted: Tue Oct 16, 2007 8:19 pm
by maredzki
Ok, so far I got the line from the beginning:

^.*wordtoreplace

it will find the word and include everything before it but can't figure out what should be after to include the remaining text in that line.

Any ideas?

Thanks!

Re: Search for a word & replace the whole line

Posted: Tue Oct 16, 2007 9:28 pm
by Abacre
Read the page:
http://www.abacre.com/afr/manual/regexpfaq.htm

You may need search for: ^.*wordtoreplace.*\r\n

Re: Search for a word & replace the whole line

Posted: Tue Oct 16, 2007 9:33 pm
by maredzki
That did it.

Thanks Roman.