Hermes – The Regex File Mover / Renamer
Last year I found myself faced with the mammoth task of renaming and sorting thousands of files according to a strict set of rules. I couldn't find a piece of software to do exactly what I needed, so I wrote one. Hermes (named after futurama bureaucrat and legendary sorter hermes conrad) is a regex based file sorting application. It allows you to change the path of a file (which covers both moving and renaming) based on regex criteria.
Say for instance you have a folder full of images of paintings by famous artists. These are all in the same folder, and it's getting a little out of hand trying to sort them all. You started out with a neat naming convention
c:\art\Hieronymus Bosch - The Garden of Earthly Delights.png
c:\art\John Everett Millais - Ophelia.JPG
c:\art\Leonardo Da Vinci - Mona Lisa.gif
But now things are getting out of hand, and you want to sort them alphabetically by LAST name, not first. Then you decide you would like to group each artist's paintings into their own folder. Then you decide it would be best to group the image formats into different sub folders too. Now, you could easily rename all the files using a program like AntRenamer, or Albert Bertilsson's wonderful RenamerNG (my favourite), but how would you go about creating the folders for each artist?
That's where Hermes comes in. Hermes allows you to use Regular Expressions to alter the path of the files, which covers both moving AND renaming at the same time. Hermes would do the job above by using a RegEx string like
c:\Art\([A-Za-z0-9\.\&]+) ([A-Za-z0-9\.\&]+) - ([A-Za-z0-9\& ]+).([A-Za-z]+)$
and turning it into
As you can see from the screenshot the app is not very complete - still using the default Visual Studio icon for instance - but it does do what it's supposed to do, and does it fairly well. I'm working on an upgraded version but for now if anyone really needs it, download it here:
Things You Need To Know:
- It requires .NET 3.5 Framework or higher, you can get that here
- It starts by default in C:\ and with Regex (.*) and recursive UNTICKED. If you tick recursive and hit process, it will iterate over every single file on your C:\ drive, which could take hours, so don't do that. Use the recursive feature carefully!
- I accept no responsibility for any loss of data as a result of using this program. Use it at your own risk and for feck sake make some backups first. I would. Even if it works flawlessly, it's very easy to get your regex messed up and tell it do rename all your files to something random. Be CAREFUL!
PS: The screenshot is from an older build that was still called RegexFileMover - the version for download is called Hermes but I'm too lazy to change that.
Tagged with: software
Posted in software