Search code examples
htmlsublimetext2notepad++aptanasublimetext

How would I add identical code to hundreds of html pages at once?


So I have a few hundred pages that need their navigation bars updated. I've looked in sublime text, aptana, notepad++ and used the search here but wasn't able to find a simple solution.

All I wish to do is add to the following code so it says

<a href="home.html">Home</a>
<a href="help.html">Help</a>
<a href="other.html">Other</a>

Rather than

 <a href="home.html">Home</a>
 <a href="help.html">Help</a>

I'm using Windows if this makes a difference. I'm aware of the built in find and replace features of aptana and sublime etc but it seems unable add new code to those 100 pages which would be preferred over using any tricks or browser hacks, but I will be willing use those tricks if absolutely necessary.

Due to certain requirements, I'm not able to use php includes ,javascript or jquery and similar . Thanks for any suggestions in advance.


Solution

  • With Sublime Text you have the option to find in all files:

    Find in all files

    You can then choose a folder to search in, what text to search for and what to replace the found text with.

    Replace text in all files

    All files in the chosen folder will be searched.