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 »

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

Post by Abacre »

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 »

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

Post by Abacre »

\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