How we updated the html code of our entire website quickly with Multiple Search and Replace

In this tutorial we will show you how to update with Multiple Search and Replace your source code of your entire website, project or other text quickly, without having to do the boring task to do a change one by one on each file.

We wanted to add a image with the Windows Logo and also some text to state the System Requirements of our software applications.

We have developed more than 30 software applications so we would have to update the code to more than 30 webpages !

Instead of doing that we relied on Multiple Search and Replace to do the job !

We noticed that we should put the Windows Logo image and text after the first large image on each webpage.

The html code each large image on the webpages ends with

<span class=”clickenlarge”>click image to enlarge</span>
</div>

We have more than one large image with this html code on each webpage so we could not do a simple find and replace for all large images because that would add the Windows Logo image to all of them and not just to the first one !

A new feature in Multiple Search and Replace V2.4 is that you can specify the “Match Index” of the text to find i.e. the index of the match, that we want to process, in the collection of each file’s found matches.

This means you can specify the index of the large image for which you want to change the html code !

We want only to change the first large image so we did set the “Match Index” setting to “Equal To = 1” in the “Extended Options” tab.

Match Index of Text to Find
Specifying desired Match Index of text to find.

We did specify the html code to find in the first tab

Specifying text to find
Specifying text to find

Afterwards, we did specify what text to insert after this html code.

Specifying the html code to add.
Specifying the html code to add.

Please note that we do not want to delete the old html code of the large image but insert the Windows Logo image html code after it.

Therefore we set “Replace Action Type” as “Insert After” instead of default “Replace”.

We also had to specify the folder where our html codes of our website are on our local computer. It is “c:\4dots Software”

Which directories to include
Specifying which directories to include in your search

We also want to change only the main webpages of our software applications and not the other webpages such as help webpages e.t.c.. The html files of these webpages have a filename “index-content.html”.

Therefore we specify to examine only “index-content.html” files in the “File Masks”.

Filename of files to examine
Specifying the filename of files to search.

We press on the “Find” button, wait a little and see the resultsĀ  by pressing on the “Results with Context” tab !

Results of search in multiple text files.
Results of search in multiple text files.

There is a list with the files with matches and by pressing on a file on the list the matches with their context are shown below.

If you want to exclude a file from the replace just right click on it and select “Exclude”.

Everything seems ok so we press the “Replace All” button.

Now we instantly have the Windows logo image and the system requirements text on more than 30 webpages of our software applications without having to do the boring task of doing the changes one by one !

Webpage of result with text replace.
Webpage of result with text replace.