Thursday, September 1, 2011

Bulk Work Tools

Recently a bunch of files needed to be fixed. Specifically a group of xml files needed to be generated online (on a logged in site) and then have text replaced in the files.
The plan was to divide the work among three of us, but I thought I could get it done faster/easier by automating it. And I was just curious to see how I could.
Sure, a simple script is one way, but I wondered what tools could do this. And so here is what I ended up doing.

I queried to get data needed to build the urls needed to generate each of the files. I put the urls in hrefs in an html file, simple regex replace to make the urls/links. I used a Firefox plugin, Download Them All, to auto download the files from all the links in the html file, and also rename them. Then I used Notepad++ to find and replace text in all files in the directory, Find in files. And that's it.
I do a lot of editing in a simple text editor, though it's usually been in Notepad2 instead of Notepad++, for source code highlighting (xml, etc), but that may change now.

No comments:

Post a Comment