replace code

General discussions about Advanced Find and Replace
Post Reply
miksas
Posts: 3
Joined: Fri Sep 15, 2006 8:34 pm

replace code

Post by miksas » Fri Sep 15, 2006 8:38 pm

hello

I have a bunch of html files

I want to specify some text as beginning and some text as end eg 'start' and 'end'

now I want to remove/delete, both start and end and everything included

but please note that 'start' and 'end' maybe text, in many lines, not one line

can you help me please?

thanks

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

Post by Abacre » Fri Sep 15, 2006 9:12 pm

You should use regular expressions.

Go to main menu - Action - Options - Batch Replace
check "Modifier S"
uncheck "Modifier G"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
start.*end

Replace with should be empty.

Note that .* means any number of any chars.

Note: if start or end contains any reserved chars like:
.,\[] etc
you should escape it with \

For example, start is font.color
so you should use font\.color
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

miksas
Posts: 3
Joined: Fri Sep 15, 2006 8:34 pm

Post by miksas » Fri Sep 15, 2006 10:08 pm

thanks but 'start' and 'end' is text in multiple lines, how can I do start.*end ?

eg start:

Code: Select all

</a></td>
</tr></table>
    </td></tr>

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

Post by Abacre » Sat Sep 16, 2006 7:43 am

\r\n is end of line.
So use the following:

Code: Select all

</a></td>\r\n</tr></table>\r\n    </td></tr>
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests