Return to Digital Photography Articles

Bulk / Batch File Renaming Utilities

Many people have a real mess of files on their hard drives, thanks to thousands of digital photos and MP3s that get copied without any thought to organization. Thankfully, some very useful batch renaming utilities can help rescue your collection in a matter of seconds!

Why Rename Files?

In the ideal world, you would organize your files as soon as you create them... but clearly this doesn't always happen. We get lazy... Soon enough, you end up with folders full of arbitrarily or inconsistently-named files.

Typical mess of disorganized filenames

The Best way to Rename Files

The best method is to rename during the copy of files to your hard drive. The reason I recommend this approach is two-fold:

  1. Renaming should be done as early as possible
  2. Automating the renaming removes the lazy human element

For most photographers, this means performing the organizing step during the importing of images from the memory card.

There are several standalone photo importing programs (and photo catalog programs) that do a great job at this. One utility that I often recommend is DownloaderPro. The creation of the folder hierarchy and file naming scheme is handled automatically.

Why Rename Now?

Unfortunately, the longer that your files are disorganized, the more likely it is that some program will have recorded the bad folder and file name choices. For example, a photo catalog associates each image file on your hard drive with an entry in a database (containing keywords, tags, etc.) If you decide later to rename the folders or files, the link will be broken, and you may have a hard time instructing the software to relocate all of the renamed / moved files.

Typical relocation error after renaming

Things get even worse if you have implemented a backup scheme. Most backup utilities only store / archive the files that have changed since the last backup. Unfortunately, changing a file's path or filename breaks the link in the backup database and the software naturally treats all of these files as having changed (new). If you change a large number of filenames / folder names in your photo collection, your incremental backup could end up being very unwieldy. You should always attempt to get your folders and files organized before you start an automated backup scheme.

Comparison of Batch Renaming Utilities

The following table lists a few of the more useful standalone renaming utilities (for Windows) that I have come across. All of these utilities are free or request a donation. If you know of another free Windows utility that is comparable to these, please leave a comment below.

Utility Ease of Use Price RegEx Metadata PreviewUndoContext
Flexible Renamer Easy Free Yes File, EXIF, IPTC, ID3, ... Live Yes Yes (SendTo)
MRename Hard Free Yes File Live Yes Yes
THE Rename Med Donate Yes File, EXIF, IPTC, ID3, ... Invoked Yes Yes (Folder Only)
Bulk Renaming Utility Med Donate Yes File, (EXIF.DateTime) Live Yes Yes

For a description of the various fields listed above, please see the section on Features in Renaming Software below.

Screen snapshots

Main ScreenRegExComments
Flexible Renamer Screenshot Flexible Renamer Screenshot

Flexible Renamer
Nice clean interface. Large number of features (eg. wide range of metadata tags, attribute updates, etc). Different levels of complexity revealed through buttons.

Regex only supports insert of file timestamp, but TagRename mode supports ID3, EXIF, IPTC and other metadata but no search & replace.

Last update 2003.

MRename Screenshot MRename Screenshot

MRename
Very plain interface. Only supports regex but has a built-in Regular Expression Builder - a nice idea, but takes some getting used to. Colored substring boxes in preview is helpful.

Only metadata supported is file date/time (not from EXIF).

Last update 2005.

THE Rename Screenshot THE Rename Screenshot

THE Rename
Substring matching outside of regex and freeform is weak. Regex is hidden in menu, and does not support tokens. Has preview but not live. Lots of options.

Free form mode allows a wide range of tokens (incl EXIF, IPTC, Music, etc.) and operations, but this mode is quite awkward to use. Has file filtering rule lists which may come in handy in certain situations.

Support forum. Regex preview always crashed on me (version 2.1.6). Last update 2004.

Bulk Renaming Utility Screenshot Bulk Renaming Utility Screenshot

Bulk Renaming Utility
Main screen shows all options -- very cluttered and somewhat difficult to follow. Regex field display is too narrow. Regex doesn't have tokens, so must combine with other options. Decent feature set although it takes getting used to the sequence of operations and location.

Has ability to extract EXIF DateTimeOriginal (not in regex), but it didn't seem to work reliably for me. No other metadata besides standard file timestamps.

Support forum. Recent updates.

 

Features of Renaming Software

It can be a daunting task trying to compare different renaming utilities as there is such a wide range of features that each may provide. However, it is important to narrow down the feature list into the elements that are most useful. The following list describes a number of key features that one should consider evaluating when looking at renaming utilities:

  • Regex Capability - All renaming programs offer some degree of search and replace. How well this feature is implemented is the most important factor to consider. The most basic implementation is the straight-forward Search & Replace. More advanced programs offer Search String Wildcards. The best programs offer Regular Expressions with Pattern Substitution.
  • Replacement Tokens / Metadata - Tokens are items that you can insert in the new filename which represent a special value, such as the current date, EXIF field, etc. One of the more useful tokens represents the EXIF field DateTimeOriginal which is the date that you took a photo (not the date the file was created on your hard drive). If EXIF makernotes are supported, it may even be possible to retrieve other unique sequencing, such as the shot counters.
  • Sequence Numbering - Sometimes, there is not enough unique information in the original filename and then it becomes necessary to have the renaming application generate an incrementing sequence number. Configuration options usually specify how many digits are created and whether or not leading zeros are used.
  • Filename Collisions - When renaming files, it is often the case that one or more of the new filenames will be identical. As duplicate filenames are never a good idea, the utility must provide some way of resolving these conflicts. Some programs simply present the user with an error, while others provide more intelligent ways to handle the name collision and continue on.
  • Live Preview - A preview feature is an absolute necessity: it means that the program will show you how the selected filenames should look after the rename operation, but before it is done. A live preview changes automatically as you change your options and is invaluable in creating more complex renaming operations, particularly in the case of Regular Expression matching.
  • Undo - When renaming a large number of files at once, there will be times when the user will recognize that a mistake has been made (especially if the live preview was ignored). Being able to undo the last renaming operation is very important, as often it will be impossible to deduce the original filenames.
  • Folder Recursion - Recursion is the ability to perform the renaming operation not only on the files within the currently selected folder, but also on files / folders inside the current folder. When dealing with large renaming operations (such as across your entire photo collection), recursion is a must.
  • Context Menu - Some programs offer the ability to launch the application from right-clicking on a group of files, rather than having to open up the application first. Context menu support can be a big timesaver if you often find yourself renaming files.
  • Supported - Working with a program that is well-supported and has recent development by the author can save you time if you happen to run into difficulties. Thankfully, most renaming programs are fairly straightforward and a utility written several years ago may still continue to perform the job just fine today.

Regular Expression - RegEx - The best feature of all!

One problem with most renaming utilities is that they try to add a renaming feature for every possible scenario that they felt might be useful. Unfortunately, there is no shortage of unique file naming requirements and weird combinations of original filenames, and so we end up with renaming that have extremely cluttered user interfaces.

The best solution is something called a Regular Expression or RegEx. RegEx is well-known to most computer programmers, but is not often familiar to the average computer user. The power in regular expressions lies in the ability to perform grouping or backreferences. Essentially, this means that you can rearrange parts of the original filename to make the new filename. Search and replace generally cannot do this.

The following table shows a few examples of what one can do with regular expressions. Note that regex commands will differ depending on the program and tokens provided (for example: assume that the token "\Y" is replaced by the 4-digit current year). In the following, the regex command is also assumed to be specified in the format /search/replacement/. In each case, I am trying to target my desired file naming scheme:

Original FilenameNew Filename RegEx Command
Copy of 20070522_1234.jpg20070522_1234.jpg /Copy of //
20070522_1234 edited.jpg 20070522_1234-e.jpg / edited/-e/
IMG_1234.jpg 20070522_1234.jpg /IMG_/\Y\M\D_/
Jungle 1234 pix.jpg 20070522_1234.jpg /Jungle (.*) pix/\Y\M\D_\1/
Img 123 - 20070522.jpg 20070522_0123.jpg /Img (.*) - (.*).jpg/\2_0\1/

 

Another great use for regex renaming is in modifying the numbering scheme that may already be used in your filenames. For example, let's say you have a list of files that were numbered without leading zeros. Numbering in file names should always use a leading zeros notation so that you don't end up with variable-length filenames. For example:

Original FilenameNew Filename RegEx Command
image1.jpg
image2.jpg
image3.jpg
image4.jpg
image5.jpg
image6.jpg
image7.jpg
image8.jpg
image9.jpg
image10.jpg
image11.jpg
image12.jpg
image13.jpg
image14.jpg

image_01.jpg
image_02.jpg
image_03.jpg
image_04.jpg
image_05.jpg
image_06.jpg
image_07.jpg
image_08.jpg
image_09.jpg
image_10.jpg
image_11.jpg
image_12.jpg
image_13.jpg
image_14.jpg

/(file)([0-9])/\1_0\2/

 

As one can see in the above examples, there is virtually no limit to the types of renaming that one can do on files with regular expressions. Note that only the first three examples could be achieved with a standard search & replace function. The last two examples demonstrate substring matching / replacement (also known as grouping and backreferences), which allows one to rearrange parts of the original filename in any order (using substring tokens \1 and \2).

More information about RegEx and how to use it:

 

 


Reader's Comments:

Please leave your comments or suggestions below!
2009-04-22marsen
 thanks really!!!!
super post
i meet Flexible Renamer super soft plus portable !
i needed to rename flv files grabbed from Temporary Internet Files
i used this regexp command maybe will be usefull for others
Search Field: (.).(\[2\])(\.flv)
Replace: $1$3

Thanks Flexible Renamer for opportunity to use regexp
and many thanks to this blog
2007-08-27Mike
 Hi Calvin,

All these GUI tools are nice, but I like to script my way around renaming photo's and I settled a while ago on the scheme yyyymmdd_hhmmss.jpg with the date/time information filled from the EXIF information. The tool I use for this is the freeware jhead.exe, which can be found at www.sentex.net/~mwandel/jhead/

No gui, just works splendidly. Also does automatically rotating of images based on the EXIF data. I run the batch command right after copying everything from my memory card. (this batch command also makes copies of every photo at a convenient 1024x768 size for easy mailing). Backups are only performed on files that are named as mentioned above.
 Thanks for suggesting a script-friendly alternative.
2007-07-23James
 Cal,

I agree with you about the power of RegEx. Before I knew what it was, I was frustrated by the inability of renaming programs to skip over the first, second, or third set of numbers in a name to get to the one I wanted to modify. For example, in "2004-10-31_halloween-007.jpg", I wanted to be able to change any of the four sets of numbers in that file name (or the word itself) without affecting the others.

Then I found "LupasRename", and it quickly became my favorite. A fantastic piece of freeware, it was a little tricky for me to get the hang of right away, but it's power made up for that soon enough. The most commonly used options are available from a right-click in the white space field immediately to the right of each tick box.

The ability to insert EXIF data, CRC32 value of a file, auto-number, image dimensions in width or height, the numbering convention I stated above, as well as command line functionality, and of course, a great help file are just some of the reasons it's proven indispensable to me. Rock solid and stable, definitely worth a look. Did I mention it's free?
2007-06-23Ambidexter
 This is an interesting review, but why doesn't it contain a word about Files Renamer by Dimonius? http://www.dimonius.ru/mysoft.html
This free utility was created by a Russian guy but there is English interface available.
Files Renamer can read MP3 tags, EXIF information and even HTML titles. It can rename multiple files in accordance with the user's script. I haven't checked all its opportunities, but it can do much.
 While Files Renamer does appear to offer a reasonable range of renaming options, I did find it somewhat difficult to use (the interface is not very intuitive). That said, I like the fact that it builds renaming scripts with variables, and supports JPEG EXIF field extraction. The script debugger is an interesting feature, but I still would prefer a live preview and an undo. I think if it had a more complete english documentation, it would be helpful. Thanks for the suggestion!
 
2007-06-17Ken
 Hi Calvin,

Thanks for this recent posting. Two free programs that come to mind are the downloading feature in IDImager (v.3.5 Lite is free) and ImageIngester, which has a help forum at The Dam Book's forum.
--Ken
 I was not aware of ImageIngester previously. Even though it may not be as streamlined as a general purpose renaming utility (no regex), it does seem to address the typical photo workflow import steps very nicely (renaming, verify, folder creation, metadata, DNG, etc.). Being cross-platform and free is an added bonus. Thanks for the pointer!
2007-06-14Nigel
 Hi Calvin

One feature that I find most useful for renaming is the ability to use embedded metadata such as the EXIF data or the "Makernotes". For example you can access the "Shutter Count" variable in the Makernotes section of images from Nikon cameras. This gives you the ability to give all of your images unique names with the shortest possible naming scheme.

It would be great to see a "Metadata" column in this comparison.

Regards, Nigel
 Great idea. I've added a column for the metadata. I have not yet encountered a renaming utility that can decode makernotes (it's a very difficult task to handle a multitude of different cameras), but I can see how this could be quite useful in a single-camera environment.

 


Leave a comment or suggestion for this page:

(Never Shown - Optional)
 

Visits!