Another question

General discussions about Advanced Find and Replace
Post Reply
tutone
Posts: 12
Joined: Thu Feb 23, 2006 9:34 pm

Another question

Post by tutone » Mon Feb 27, 2006 2:21 am

Roman,

I posted this on another post... not sure if you saw it...

thanks again for you help... you are amazing...

What about this problem...

I have this link in about 2000 different files and in each file the exact link is repeated about 30 times.

I need to place an <H1> tag for the first instance of the link in that file and then <H2> for the second and so on... starting over with each new file.

The link

<a href="StandardWorks.html">The Standard Works</a></small>

the result

<h1><a href="StandardWorks.html">The Standard Works</a></small></h1>

<h2><a href="StandardWorks.html">The Standard Works</a></small></h2>
<h3><a href="StandardWorks.html">The Standard Works</a></small></h3>

... and so on it that file....

and then repeating again in the next file

<h1><a href="StandardWorks.html">The Standard Works</a></small></h1>
<h2><a href="StandardWorks.html">The Standard Works</a></small></h2>
<h3><a href="StandardWorks.html">The Standard Works</a></small></h3>

... and so.

Is this possible.

thanks

tutone
Posts: 12
Joined: Thu Feb 23, 2006 9:34 pm

Post by tutone » Wed Mar 01, 2006 2:01 pm

Roman,

Did I use up all of my help tokens? If so, I understand...

thanks

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

Post by Abacre » Wed Mar 01, 2006 2:34 pm

Advanced Find and Replace can solve this task. But it's quite tricky
in terms of specifying needed parameters.
Please send a sample HTML file to support@abacre.com specifying what
is the link (<a href="StandardWorks.html">The Standard
Works</a></small> in your example).
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

tutone
Posts: 12
Joined: Thu Feb 23, 2006 9:34 pm

Post by tutone » Wed Mar 01, 2006 6:19 pm

I will send you that html...

but first... i looked through your forums and online first before asking... as i think that i am being a pest... but

I can't figure out how to do a counter

i have a link that is:
<a href=".html">

and i need to to add a number and increace each time.

<a href="1.html>
<a href="2.html>
and so on...

i tried doing the %n>00>

but i am lost.

thanks

tutone
Posts: 12
Joined: Thu Feb 23, 2006 9:34 pm

Post by tutone » Sat Mar 04, 2006 7:21 pm

Sorry for the bump... but i wasn't sure if you saw my previous post.

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

Post by Abacre » Wed Mar 08, 2006 12:11 pm

The problem is: in classical regular expressions you cannot insert
number of replacement. In your case you should use context oriented
r.e. For example, are you really sure you need:
<a href="1.html>
<a href="2.html>
and it may go to <a href="100.html> and <a href="101.html>?

So you should describe exactly your task using concrete strings and
provide us with sample test file and resulting file which should be
after replace.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests