tenpastmidnight blog

Making hay while the sun shines

Editor that allows multi-line search and replace

I recently needed to take lumps of code out of a large number of pages for a client (EA Heliskiing.) They had lots of Javascript in-line in the page, and I was converting it to be a single external Javascript file. Having lumps of Javascript in the page is a bad idea - it means to change anything you have to update multiple pages rather than just one, and if it's in an external file the visitor's browser can cache it, meaning it won't need to download the same code every time a new page is loaded, which makes browsing quicker.

I needed to search and replace one multi-line section of code, with another, two-line section. My normal text editor (PFE) can handle mutli-line searching, but on a large amount of code it's tricky to set up because you can't see the several lines in the search box. I started looking for an editor that could take a large lump of text and search and replace that across multiple pages. Dreamweaver can do that very well, but I don't own it and I don't think it's worth buying just to use that one function.

After trying a few I've ended up with EditPlus, which has what I want in it's 'More' options in the search and replace facility. Unfortunately it's pay-for, although inexpensive, and I'm not interested in everything else it does as I'm happy enough with my PFE not to want to change.

So... if anyone knows a free editor or utility which will do what I want, please let me know. Otherwise I'm still looking for an editor which is as small, quick and easy to use as PFE, but has a little extra functionality in the search-and-replace stakes.

This page is powered by Blogger. Isn't yours?