Search for a word & replace the whole line

General discussions about Advanced Find and Replace
Post Reply
maredzki
Posts: 3
Joined: Tue Oct 16, 2007 7:44 pm

Search for a word & replace the whole line

Post 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!

maredzki
Posts: 3
Joined: Tue Oct 16, 2007 7:44 pm

Re: Search for a word & replace the whole line

Post 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!

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: Search for a word & replace the whole line

Post by Abacre »

Read the page:
http://www.abacre.com/afr/manual/regexpfaq.htm

You may need search for: ^.*wordtoreplace.*\r\n
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

maredzki
Posts: 3
Joined: Tue Oct 16, 2007 7:44 pm

Re: Search for a word & replace the whole line

Post by maredzki »

That did it.

Thanks Roman.

Post Reply