Page 1 of 1

Another question

Posted: Mon Feb 27, 2006 2:21 am
by tutone
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

Posted: Wed Mar 01, 2006 2:01 pm
by tutone
Roman,

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

thanks

Posted: Wed Mar 01, 2006 2:34 pm
by Abacre
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).

Posted: Wed Mar 01, 2006 6:19 pm
by tutone
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

Posted: Sat Mar 04, 2006 7:21 pm
by tutone
Sorry for the bump... but i wasn't sure if you saw my previous post.

Posted: Wed Mar 08, 2006 12:11 pm
by Abacre
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.