I'm trying to find the right tool for this job. I've got a lot of ideas, but was wondering if people might have some more ideas. Here's the problem: Links on a site got changed. There's 1300+ files that need to be updated. The links look something like this: a href="/dir1/dir2/[filename].HTML" The trick is I need to preserve the file name and swap out the /dir1/dir2/ .HTML part (yes, the ".HTML needs to be dropped). But wait, thats not all! There's about 12 different file types ranging from HTML, PDF, GIF, JPEG, etc that need to be replaced as well. So to give an example, we want to change "/dir1/dir2/[filename].[file extension]" to "/newdir/newdir2/[filename]" (no file extension). Easy eh? The catch is half of these files are encoded as UTF-8 with multi-byte encoding. So your run-of-the-mill app HAS to support UTF-8 (and ideally on the fly). Solutions I've been playing with: -- Edit+: This program rocks. It rocks a lot. I created a regexp search and replace which works great. Two problems: 1. Its multi-file search/replace is a pain in the ass. It works great on one file at a time. This can be painful when there's 500+ files. 2. It does NOT support UTF-8 two (or more) byte encoding. -- BBEdit: Although a Mac program, this program shows the most promise. We've only done some quick tests and it appears like it may do everything we need it to do (multiple files and regexp for the replace). Sadly, its on a Mac but if it gets the job done then its cool and I'm happy. -- WinGrep: This program really rocks (and is very fast) and I was able to setup a regexp that works for searches, but it doesn't do regexp for the replace string so we're stuck. We can use this tool to find the matches, but we can't use it to do the replaces. It does handle UTF-8 files nicely. -- Perl: I haven't looked into this. If it comes down to it, I'll write something to parse the files. Not sure if Perl is UTF-8 friendly, but maybe if I tell it to handle the files as binary, then life will be good. -- Java (JSP/Servlets): I wrote something that does this. Its not the fastest thing and it completely butchers the UTF-8 files. Maybe if I fiddle with the code to treat the files as binary it might work a little better. -- Authentic Unix flavored grep: I understand with the right command line options, you can get grep to do a ton of nifty stuff. I am not a master of this tool but I understand WinGrep is based off of it. The question is if it can handle a regexp for its replace string and will it destroy UTF-8 files. -- Kick it old-school: I don't want to do this by hand so this is not an option. -- Other thoughts or ideas to doing this?