One of my antivirus benchmark is loading of a list of websites. To automate this test, I used WATIR to auto feeding of 50 websites one by one to Internet Explorer and then used HttpWatch to record the time taken to load all websites. The 50 websites are grabbed from real websites with an offline downloader and I noticed one of the problem is some sites has a few lines of javascript tracking code which makes the offline website load externally and that affects the accuracy of the benchmark. If the javascript lines are removed, then the offline website loads locally rather than requiring Internet connection.
Deleting or replacing a single line can be easily done automatically using TextCrawler but it doesn’t work on multiple lines. I didn’t want to edit all 50 HTML files and manually removing the lines so I looked for a more automated way. I found a really good free software that can remove or replace multiple lines of code and it takes only a few seconds to complete the job.
InfoRapid Search & Replace is a pretty old software that was last updated on 07/12/03 but it worked perfectly when I tested it. All I needed to do is to set the directory that I want the software to search for and at the Search tab, simply paste a line of the javascript openings and leave the replace with blank. Below is an example scenario to help you understand better.
Here are a bunch of codes which I want to remove from a folder that has 50 HTML files.

I ran InfoRapid Search & Replace and you will see the window is being separated into two. The top window is the search results and at the bottom window on Search tab, this is where I command the software on where I would like to search and what lines that I want to replace. The “search for” option is one of the most important value which instruct the software what to look for. If you look at the code above, the first line starts with <script type=”text/javascript”> and we should enter that in the “search for” box followed by .* and last line that you want to stop searching. As you can see the the last line is </script>, so the complete line for search for becomes:
<script type="text/javascript">.*</script>
In files would be the file extension that you want the software search for. For example if you only want to search and replace .txt files, then you should just enter .txt in that box. If you want to search for multiple extension, you can separate them with |, for example .txt | .html

In directory would be the folder that you want the program to search. Check the “with subdirectories” if you want InfoRapid Search & Replace to crawl into deeper folders. The multiline search option is very powerful in the sense that if you have used the search expression John.*Smith and multiline search is on, then InfoRapid finds also such text passages, where John and Smith lie in different lines. If this option is off, then John and Smith must be in the same line to be matched by the search expression. That’s all you need to set if you want to search.
If you want to replace or delete multiple lines, after setting up all the information on the Search tab, now click on Replace tab. To delete, leave the “Replace with” blank and click Start. When found any matches, a confirmation window will be prompted before taking any action and showing you what will be replaced in the actual file.

InfoRapid Search & Replace is very useful, a huge time saver and also a freeware and may be copied, distributed and used for private purposes without any limitations. If you want to use it commercially, you will have to purchase the license at 25 Euro) for every user.
[ Download InfoRapid Search & Replace ]
Related posts:
Dam i forgot the link to the Swiss File Knife (sfk) tool.
stahlworks.com/dev/index.php?tool=sfk
thank u very match bro.
Hi Raymond,
In case you need to automate the process using a script the Swiss File Knife (sfk) is a very good tool to do that kind of work on files.
The syntax can be a little difficult at first but the page have some examples to help.
___
Rui Paz