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>
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.
We did specify the html code to find in the first tab
Afterwards, we did specify what text to insert after this html code.
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”
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”.
We press on the “Find” button, wait a little and see the results by pressing on the “Results with Context” tab !
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 !