WebDev - Tips and Tricks (I)

Multi Files Text Replace

A couple of days ago I had to replace on a website with static .htm pages the old Google Analytics tracking code with the new one. And the website was not your friendly, five to ten pages website! So I looked around and found this free tool: Auto Replace. The tool searches and replaces HTML code on multiple files, so with one “move” I replaced the code in all of the pages. I think it’s a nice tool for webmasters and web developers to have around. You never know when you need to modify a link that appears in different web pages or a text in the footer of the page that needs to be displayed all over the website.

Auto Replace 1.0

The tool is written by Andreas Jönsson, is freeware, but no longer available for download on his website, so you can download it here: Auto Replace 1.0 The .zip archive contains an .exe file that will launch the application.

auto_replace

Using the free multi replace tool is easy to:

  • select the directory that contains the files and the extension of the files that you will be parsing (i.e. .htm, .php, .txt)
  • insert the text to be replaced and the text that is replaced with
  • hit [Start]

Tips:

  1. It is advisable to back-up the files before applying any changes. Just to be safe.
  2. Be careful when changing small words or letters as the tool will replace any occurrence no matter if it’s a stand alone word or if that word is part of a larger word. For example, if you decide to replace the word ‘car’ with ‘bike’ and in your text you have the words cars, carwash and carbide, you’ll end up with bikes, bikewash and bikebide. To avoid this add a space before and after car, like this: ‘ car ‘.

If you like the application or if you find new uses for the tool, please do leave a comment and let us know.

Post a Comment

Your email is never published nor shared. Required fields are marked *