0

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.

Bob
  • 3
  • 2
  • http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file – Govind Singh Mar 24 '15 at 06:41
  • So all the files already include the two line menu? And you want to "extend" it? –  Mar 24 '15 at 06:52
  • Yes I simply want to add that third line/extend it. But I need to add that new line to hundreds of files. Manually opening a file adding the line and doing that hundreds of times would work. But it seems horribly inefficient. Due to strict requirements, any of the normal tricks using php isn't an option. My hope was there would be some sort of text or html editor that would so something like "Add Other below Help to all html files in x folder. – Bob Mar 24 '15 at 07:05

1 Answers1

2

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.

Martin Benninger
  • 597
  • 5
  • 13
  • It was a tad odd to add items to the replace line, I had to manually type it out, copy and paste it in there. But this is absolutely perfect and does exactly what I need so I have marked it as the answer. I would like to note that one of the posts http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file would have worked but not as cleanly as i had hoped. As i would still have to add a line to each of the files once. Thank you. I would never have noticed that i could replace a line of text with extra lines. – Bob Mar 24 '15 at 07:33
  • Character limit. I'd also like to say I found a program called text crawler 3 that I just found that does this as well shortly after your solution. For my needs being for commercial use, and already having sublime text, your post is also the cheaper of the two programs for me. – Bob Mar 24 '15 at 07:36