Allright, here's the problem. I was hired to do some web work for a local psychologist, and was informed i was needed to make 'minor corrections'... what they failed to mention is that their site is comprised of approximately 1200+ html files (plus images), and i have to update the links on each one separately, because they couldnt use one template and have it in a frame...

what i think would be the best way to do this is for me to have a script that would open each file, find a certain string, and replace it with the new version, and proceed to the next file.

is there any way to do this?
Explain what the link is now and what it needs to be changed to, and I'll do it for you.
alright, but you can wait, since i know you're busy...

can we just say find 'archives 2002', and replace with 'archives 2001'? i'll fill in the actual HTML when i have it on hand, etc... (i'll make sure to escape chars where needed Razz)
Ok, now these are all in a directory? And they're all either .html or .htm? Are there some subdirectories, or just one huge dir?
Get Crimson Editor (or any generic editor with mutiple files opened at once) and do a Replace All
KermMartian wrote:
Ok, now these are all in a directory? And they're all either .html or .htm? Are there some subdirectories, or just one huge dir?


subdirectories of subdirectories, sometimes subdirectories there of... it's a bitch, and if i dont figure it out today, i'm gonna tell them to pay what they owe and quit...
Actually, this is a really easy problem. I can solve this quite easily. Lemme just finish my lab report first. Smile
dont i feel smart now...

alright, thanks a million... if i'm gone by then, i'll be back tomorrow...
Word. So will I. Smile
yay...

the bad news: i was supposed to have this done by Easter (they assigned it to me last friday... wdf is wrong with them, i will never know..)
heh, that would be easy to do in Python too (client side then - not that it would matter)
Indeedy. So I guess you need this asap?
Preferably by Easter? Razz

I told the guy I needed a little more time, and mentioned that I'd been misled, and he said it was ok...
Alrighty, I'll see what I can get you then. In the meantime, can you get me the specific strings? Smile
if i was at home, i woudl... i'm at a friends ATM though... (the friend with the dead comp...)
Say hello to preg_replace() and str_replace(), PHP fans. Very Happy You might also find the opendir() function handy as well.
jpez wrote:
Say hello to preg_replace() and str_replace(), PHP fans. Very Happy You might also find the opendir() function handy as well.
But using them together! Shock They fired him anyway. Smile
Surprised That's too bad. You would have to be diabolical indeed to use them together.
jpez wrote:
Surprised That's too bad. You would have to be diabolical indeed to use them together.
Indeed, my thoughts precisely.
KermMartian wrote:
jpez wrote:
Surprised That's too bad. You would have to be diabolical indeed to use them together.
Indeed, my thoughts precisely.
Indeed. Do you get the feeling ever that we say `indeed` on this board too much?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement