The Dopefly Tech Blog

« The Dopefly Tech Blog Main page

The Regex Mass File Renamer - Useful little things

posted under category: dotnet on December 25, 2005 by Nathan

So, happy holidays all. Given a little extra time this morning, waiting for the in-laws to come back from shopping, I felt the need to rename some files. Ok, a lot of files. All of us CF guys can attest to the ease of getting it done in our favorite tag-based language, but what about running it without having to start 3 services on my local machine? That's where knowing a 2nd language fits in.

So, with an effort to (a) play with visual studio 2005, (b) test drive .NET 2.0, and (c) actually make something useful, I present to you the Regex Mass File Renamer. Install the .NET 2.0 runtime, it came out a couple months ago, download my app, and run the exe in the build folder.

It's not fancy, it's not all that great, but it's what I do in my spare time to make life just a little easier for myself. Choose a folder, enter a regular expression in the 2nd box, and something to replace it with in the 3rd, then hit start and it will change the filename (sans extension) of any files in the chosen folder.

Regex Mass Renamer
The zip file is my whole project folder from VS2005, so if you have Visual Studio '05, even the free (for a year) express version, you can open the project and play with the source.

Disclaimer: I won't claim to be any sort of OOP expert or great winforms programmer. The code may suck beyond belief. In fact, I'd like to know if it does. Use at your own risk. Make a backup of any files you plan on working with. The source is provided so that I cannot be held responsible with how the program works, or for anything that happens when running it.

Nathan is a software developer at The Boeing Company in Charleston, SC. He is essentially a big programming nerd. Really, you could say that makes him a nerd among nerds. Aside from making software for the web, he plays with tech toys and likes to think about programming's big picture while speaking at conferences and generally impressing people with massive nerdiness and straight-faced sarcastic humor. Nathan got his programming start writing batch files in DOS. It should go without saying, but these thought and opinions have nothing to do with Boeing in any way.
This blog is also available as an RSS 2.0 feed. Click your heels together and click here to contact Nathan.