|
-
Dec 16th, 2005, 04:49 AM
#1
Thread Starter
Junior Member
Strings in question
Hi all,
i have html files similar to this
<DIV>A file with tags similar to this</DIV>
<DIV CLASS=LOH>
<FONT COLOR=#1C2A5E SIZE=4>Objectives</FONT>
</DIV>
<DIV CLASS=LOBL>
<FONT COLOR=#FC8051>*</FONT><FONT> Convey the scope of microeconomic theory and explain why theory, in general, is essential to understanding and predicting real-world outcomes.</FONT>
</DIV>
I have to replacement tags for all such tags
example:
<DIV>A file with tags similar to this</DIV>
should be replaced as
<P>A file with tags similar to this</P>
<DIV CLASS=LOH>
<FONT COLOR=#1C2A5E SIZE=4>Objectives</FONT>
</DIV>
should be replaced as
<box id="c##-box-####"><FONT COLOR=#1C2A5E SIZE=4>Objectives</FONT></box>
and so on...
i have used straight forward replacement macros but i am able to change the starting tags only...
how can i specify the full range of text from <DIV..... to </DIV> and replace them with my tag?.
i am currently doing those manually and it is a huge pain. Please help me with a solution as i have many files like these
Thanks in Advance
-
Dec 16th, 2005, 06:28 AM
#2
Re: Strings in question
You'd have to sstart from the begining of the file, and look for the specific opening tags, then look for the first closing tag that matches (assuming no nesting) then use the replace function on that part of the file.
Essentially recreate the file but change parts as you go.
Not sure the best method, but I suggest you flowchart how you would do it if you were doing it manually yourself then change that flow chart into code.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|