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 » Tue Oct 16, 2007 7:52 pm

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 » Tue Oct 16, 2007 8:19 pm

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: 1198
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Re: Search for a word & replace the whole line

Post by Abacre » Tue Oct 16, 2007 9:28 pm

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 » Tue Oct 16, 2007 9:33 pm

That did it.

Thanks Roman.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests