Page 1 of 1

A quick question

Posted: Tue Feb 07, 2006 10:16 pm
by daroga
Hello!

I'm in charge of getting an essay file website converted over to a new layout for my school. Using Style Sheets should make things easy, but I need to do some grunt work to get the pages set. My apologies for being a total newbie on this. I'm dug into the RE lists in the Help and some threads on here, and might have looked what I wanted to do right in the face but didn't know it.

Essentially, this is how the code looks now:
<li><a href="http://www.website.edu/library/Essays/Authors/A/FileName/FileName.htm">
Essay Title</a></li>

I want to get it to be:
<LI>Essay Title | <A HREF="FileName/FileName.pdf" CLASS="main">PDF</A> | <A HREF="FileName/FileName.rtf" CLASS="main">RTF</A> |</LI>

Obviously, most things on that change are a simple find and replace. But is there a way to get the program to grab the "filename/filename" string from the original and copy into both the PDF link and the RTF link in the new code? All of the files are in a directory matching the filename of the files contained there in, thus the PDF and RTF for "FileName" would have the path "FileName/FileName.pdf" and "FileName/FileName.rtf" respectively. We are doing away with the .htm files all together.

Thank you so much! This is such an awesome program.
Tim

Posted: Tue Feb 07, 2006 11:35 pm
by Abacre
Hi,

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

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
<li><a href="http://www.website.edu/library/Essays/Authors/A/(.*)htm">(.*)</a></li>

Replace with:
<LI>$2 | <A HREF="$1pdf" CLASS="main">PDF</A> | <A HREF="$1rtf" CLASS="main">RTF</A> |</LI>

That's all. I verified it works perfectly.

Posted: Wed Feb 08, 2006 1:35 am
by daroga
That worked completely flawlessly. Thank you so much!!!