Help required in a script to replace...

User 111435 Photo


Registered User
43 posts

I run a number of websites and I find the Replace option, in the Coffee Cup Editor, very useful in replacing code in a large number of HTML files, in one go.

However, in about 1000 HTML files, I have the following construction:-
<OBJECT CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH=800 HEIGHT=600> <PARAM NAME="SRC" VALUE="FILENAME.pdf"><EMBED SRC="FILENAME.pdf" HEIGHT=800 WIDTH=600> <NOEMBED> Your browser does not support embedded PDF files.</NOEMBED> </EMBED></OBJECT>

which I would like to be replaced by:-
<meta http-equiv="refresh" content="0; url=FILENAME.pdf">

Where FILENAME, differs in each file.

My question is - Has anybody got a script, which would enable me to do this?

(The reason I need to do this, is because there are now new OSs coming along, so my original construction, which displayed PDF files, now causes problems with the new OSs.)
User 187934 Photo


Senior Advisor
20,245 posts

How many can you manually do a minute?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 111435 Photo


Registered User
43 posts

Thanks,

About two per minute.
User 187934 Photo


Senior Advisor
20,245 posts

That would be faster then I could come up with anything usable.:lol:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 310610 Photo


Registered User
3 posts

I strongly recommend TextPad for jobs like this
It has regular expressions so you can replace (simplified example) .. abc<file>def by ghi<file>jkl
in multiple files in one pass -- about 10 minutes work by the time you have tested it.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.