Hi,
I have over a hundred HTML files with a unique JPG picture name in it. Want I want is to copy the JPG file name and replace with a new code .
Example:
File name HTML file: N_art_13.html (or N_art_256.html)
Source:
<IMG SRC="b_13.jpg" ALT="Artikel 111" BORDER="0">
Replace into:
<a rel="lightbox" href="b_13.jpg">
<img src="b_13.jpg" width="300" height="261" class="style11"></a>
Number in filename (13) is the same as in d the code.
I hope that you can help me.
Thanks in advance,
Geert
Copy and replace
Re: Copy and replace
Go to main menu - Action - Options - Batch Replace
check "Include File Name into Search Scope"
check "Modifier S"
Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
N_art_(\d+).html\r\n(.*)<IMG SRC="b_\1.jpg" ALT=".*" BORDER="0">
Replace with:
\r\n$2<a rel="lightbox" href="b_$1.jpg">\r\n<img src="b_$1.jpg" width="300" height="261" class="style11"></a>
That's all I verified it works perfectly.
check "Include File Name into Search Scope"
check "Modifier S"
Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
N_art_(\d+).html\r\n(.*)<IMG SRC="b_\1.jpg" ALT=".*" BORDER="0">
Replace with:
\r\n$2<a rel="lightbox" href="b_$1.jpg">\r\n<img src="b_$1.jpg" width="300" height="261" class="style11"></a>
That's all I verified it works perfectly.
Re: Copy and replace
Roman,
Thank you very much.
Time to purchase the software
Regards,
Geert Gernaat
Netherlands
Thank you very much.
Time to purchase the software

Regards,
Geert Gernaat
Netherlands
Re: Copy and replace
Hi Roman,
There is something strange with AFR or on my computer.
If I past your code into AFR and execute the program with regular expressions AFR can't find any HTML document.
But if a open the file(s) in a HTML editor or notepad and save the document without any changes, at that moment AFR find the string and replace it with the correct code???
Do you have any idea hiw this is possible.
Regards,
Geert
There is something strange with AFR or on my computer.
If I past your code into AFR and execute the program with regular expressions AFR can't find any HTML document.
But if a open the file(s) in a HTML editor or notepad and save the document without any changes, at that moment AFR find the string and replace it with the correct code???
Do you have any idea hiw this is possible.
Regards,
Geert
Re: Copy and replace
It's not clear what do you mean. Could you please explain it again?
Other programs may exclusively use your file without giving right to AFR (or other programs) to use it. So you should normally close other programs using the file before using AFR on the files.
Other programs may exclusively use your file without giving right to AFR (or other programs) to use it. So you should normally close other programs using the file before using AFR on the files.