A few weeks ago one of my websites got hacked. Well, not really hacked but a group of annoying people with too much time on their hands got hold of my FTP paswoord and had a script inject some of the website files with malicious code.
The problem was that many files in many directories were infected. Cleaning them manually would have taken me hours and besides, if it would happen to me again I'd be spending more hours to do the same. Sooo.. I decided I'd make an application to do the hard work for me.
The *nix fans among you are most likely familiair with the 'GREP' command. What it does is that it searches for a specific string inside text files. If the string is found it will return the filename of the text file to you. Very useful.
But as nice as grep is, it lacks some functionality. Grep searches, it doesn't edit. What I wanted was an application that:
- searches for files with specific extensions in a directory
- optinally searches in subdirectories of the main directory
- is able to exclude files created before a certain date & time
- searches for a very long strings that start with a specific substring
- optionally searches for long strings that end with another specific substring
- remove the found strings (thus cleaning the text file) or replace it with another string
- count the number of matches
- count the number of directories it found matches in
- optionally stores my settings
Enter Grep & Replace, an Excel application.
Ok, reading the above I realize your head must be spinning. A picture tells more than a thousand words so have a look at the the screenshots below. I think it explains pretty much what I wanted.
This application works fine in Excel 2003 and as far as I could test it also in Excel 2007 but if you find any bugs please let me know! I pretty sure it won't work on Apple Office versions, sorry.
You may use it freely both in private and commercial environments, keep it, spread it around and never pay for it. it is my gift to the internet community to battle the no-good-for-nothings that like to mess up websites of other people for no good reason at all. Just leave the credits in tact. I took me quite some time to create this application.
Oh, and if you want to donate.. you're most welcome :-) Please ask me for details.
You can download the application by richt-clicking here and select to save the target as...
If you doubleclick the downloaded xla file it should open up in Excel. Note that you should enable macros to run!
Grep & Replace menu in Excel for Office 2003 and Office 2007.
Grep & Replace interface. The settings can be optionally stored in an ini file in the TEMP directory.
Grep & Replace Help menu.