Take filename & update html file

Hi team,

I’m looking for a script that can be applied to a folder of hundreds of little html files…

It needs to:

  1. Take an arbitrary filename of a .html file
    Eg. london_summer_festival.html = “london_summer_festival”

  2. Finds any reference to the filename within that .html file, and replaces it to a set name like “images"
    Eg. href="./london_summer_festival/photo123” = href=“./images/photo123”

  3. Save!

That’s it. I’m sure it’s pretty easy for someone else, but I’m still learning this voodoo!

Thanks! Adam

The best way of learning is by doing

Show us what you’ve got so far.