Every year, more than one million photographs captured in some of the harshest conditions on the planet arrive at National Geographic magazine. From our trials and tribulations, learn how to conquer your own digital photography challenges.
Renaming 13,000 photographs ... and XMP files, too
Posted Sep 19,2007


Here's a digital photography challenge: what would you do if needed to rename thousands of images? 

  • I received 13,000 images from a photographer.  The files are named incorrectly and many hundreds of images have the same name.
  • All files need to be sorted by the time they were created and renamed from 1 through 13,000.
  • The files are located within more than 140 sub-folders by file category and in no apparent date order.
  • Each of the images has an XMP file containing the caption information and this file needs to be renamed exactly as the file is named.

What program(s) would you use to quickly rename the photographs?

Each program has strengths and here is how the software battle went:

iView Media Pro: It does not allow XMP files to be imported.  This is a no-go.
Expression Media: It does allow XMP files to be imported but it treats the photo and XMP as separate files so the renaming would not work.  It's out of the race.
Photo Mechanic: It renames RAW+XMP but folders make the job practically impossible. How would I know which folder contains the first, second, third image made on this assignment?  Those images could be spread amongst all of the folders. 
Bridge: Same as Photo Mechanic, it can only view a single folder at a time which makes the rename task practically impossible.  Update: Bridge CS3 has a button on the filter panel that allows all items inside of a parent folder to be visible.  By flattening the folder structure one would be able to sort by date and time captured and then rename RAW+XMP.  Thanks, Scott!  Update again: Bridge CS2 keeps this feature hidden in the Find window (Edit / Find then check "Include All Subfolders" and "Find All Files").  Thanks, Dan!
Lightroom: It understands XMP sidecar files and renames appropriately.  It also is able to sort all of the images in the project by the capture date.  We have a winner!

Do you know other ways to solve this problem? Leave them in the comments.

Posted by Account Deleted | Comments (28)
Filed Under: Photography Tips, technology, workflow


Marten Blumen
Sep 19, 2007 4PM #

This tool might do it:


Scott Winklebleck
Sep 19, 2007 4PM #

I would go with lightroom, make sure "write changes to XMP" is on.
But FYI Bridge can view multiple folders at once. Show the Filter tab, navigate to the folder that holds all the sub-folders, and click the icon that looks like a no-folder. next to that you can choose how it sorts.

Good Luck.

Evan Wilder
Sep 19, 2007 4PM #

@Scott - I missed that Bridge CS3 could peer into sub-folders with that icon on the Filter menu. What a useful change between CS2 and CS3!

Bill Westfield
Sep 19, 2007 4PM #

Lightroom would be my choice as well. I've been using it since beta (or suffering through it as we all did with beta 4!) and cannot say enough good about it's workflow features.

I'm leaving today on a shoot that will take well over a month and most likely involve 10,000+ images. If it weren't for lightroom, I'd probably have to jump off one of the cliffs (and shoot myself on the way down just to make sure) to avoid the categorizing that will follow!

Nicolas Bourré
Sep 19, 2007 4PM #

My solution is kind of awkward, but could work. I would use AutoHotkey. This software is a keyboard/mouse simulator. You just have to record by hand the mouse and keyboard moves you do to read and rename your XMP files. And after you make a loop of let say... 13000 times.
If you could send a few samples, I could maybe help more. I'm a software developper. I could develop something easy and fast.


S Russell
Sep 19, 2007 4PM #

iMatch would likely do the trick. It's very flexible and adaptable, and handles XMP sidecars.


Matthew Saville
Sep 19, 2007 4PM #

I know Lightroom is all the rage these days, and with some reason, but personally I'm addicted to Bridge CS3 and it's direct folder viewing, none of this "import into library" nonsense like with Lightroom. (and Apeture)

Like Scott said, the most handy thing would probably be to set Bridge to NOT generate high-resolution thumbnails for every single image, which would take an hour or so with 13,000 images, (especially if RAW) ...then just go to the filters panel and click the little icon to see down into sub-folders. Give it a while to see into every single folder and bring up low-res thumbs for everything, then just select all, and use the batch rename tool. You can also right-click and go to "File Info", if you want to add keywords and copyright info, of course.


Matthew Saville
Sep 19, 2007 4PM #

BTW, Bridge can also sort images by date created, or any other way you want, and works just as well with XMP sidecar files as Lightroom.

Actually LR and BR have an almost identical engine, just with a different interface. So, go with whichever interface works best for you!

Working with thousands of adventure photos for myself, and thousands of wedding photos for clients, I simmply came to prefer Bridge's direct folder viewing, so I can simply dump a folder structure onto my hard drive and then go into Bridge and have it display exactly the same way, without having to "import" anything and completely re-structure my organization...


Sep 19, 2007 4PM #

Looks like a job for a simple Unix shell script, such as this:

#! /bin/ksh

# set input and output directories

# initialize file counter

# loop on full path to files as
# listed recursively and
# time-sorted
for path in /bin/ls -Rt $idir
# strip extension from name
# rename each file
mv $path $odir/$count.$ext

Suraj Joshee
Sep 19, 2007 4PM #

Try Bulk Rename Utility:

Free! Fast! Incredibly Powerful!

Joe Reddy
Sep 19, 2007 4PM #

FotoWare's FotoStation Pro can do all of this and much more. FotoStation PRO has been designed for people who work professionally with digital assets. It's not free but it's a tremendous software application and will make working on daunting tasks like this fun.


Sep 19, 2007 4PM #

Send the files in a CD to me and you can take them back, ALL RENAMED as you please the evening of next working day. ALL THIS FREE OF COST FOR NG. NO FILE SHALL BE KEPT WITH ME OR SOLD. WORK SHALL BE DONE WITH 100% CONFIDENTIALITY

Sep 19, 2007 4PM #

One word: Intern. ;)

Sep 19, 2007 4PM #

Give a look at Breeze Browser Pro. It's what I have been using to rename all my photos. Work a lot faster than Lightroom/Bridge.

I'd rename all the files to something new, now that you have no two images with the same name put all the files into one big folder. Then sort all images by time stamp and then rename them one more time 1-13000.

Albert van Veen
Sep 19, 2007 4PM #

Easy answer: use Windows Commander or Total Commander to replace Microsoft's useless standard tools. Renaming any number of files in a flash. It also lets you easily change the time stamp back to what it should be. BTW: anybody who has been silly enough to use Microsoft's download tools will automatically have this misnomer problem.

Jim Engelbrecht
Sep 19, 2007 4PM #

Best by far that I have found - Aperture by Apple. Has given us the best work flow for our shoots - non destructive raw support,great meta data management and a breeze when I needed to rename images submitted by a photographer for an assignment.

Don Temple
Sep 19, 2007 4PM #

Lightroom is the way to go with this type of task. However, there is a bug with the capture time. When the time changes [Standard time to Daylight Savings and vice versa] the actual capture time in the EXIF changes also by one hour.

Katie Joseph
Sep 19, 2007 4PM #

If I were doing it, (and in a hurry) I'd use Photo Mechanic's rename feature to append one character to the files in one folder, another character to the next, and so on. That solves the problem of two files from different folders having the same name.

Then, move them all to the same folder, sort by capture time, and rename.

Lastly, I'd call the photographer (or his/her assistant) and make sure they know how to do it the right way. :)

Joel Marty
Sep 19, 2007 4PM #

There is an amazingly powerful, compact, free, little utility called Irfanview which, although it is useful for editing and viewing of all types of files, I have used it for years primarily for batch work.


You do not need technical knowledge of batch processing to do this. One can simply select and assemble all of the desired photos and sort by date/time and rename to any format one sets.

Through the batch processing, one can keep all information the same e.g. EXIF, IPTC, JPEG Comments, etc. while changing other information as one desires i.e. file name, canvas size, time stamp, color depth, etc.

Because this is such an efficient program, if one is totally unfamiliar with such batch and naming actions, I recommend experimenting with duplicate files. As with any program doing batch functions, mistakes ARE permanent AND irreversible.

In fact, just recently, I copied all of the thousands of images from five cameras from a summer’s worth of European travels into five folders. Just to be cautious, I date sorted within the folders and renamed them with names relative to the photographer/camera identity. Then I did a file search to select all and date-sorted and renamed them with an appended number.

The end result provided an integrated list of photos, retaining all original information while simultaneously crediting the original photographer.

Binkai Lee
Sep 19, 2007 4PM #


Chad Cooper
Sep 19, 2007 4PM #

I would (and do) use a Python script for this:


Sep 19, 2007 4PM #

You are aware that Photo Mechanic can open more than one folder right? You just click the folders and select "Open in current contact sheet." Command-A and voila. Granted, you have to click each folder individually, but the ability is there.


Laura Nobody
Sep 19, 2007 4PM #

Hey, wow what madness when all you want to do is shoot then view? Who is that guy who wants to catalog everyone elses stuff for completely nothing and is faster than FED EX? What a nice guy! I have some chores I neglected over here!

Simple software for idiots here, I use two which I swear by, one is my camera solution software when it's my own massive catalog necessity upload or problem and the other is a type of Photo Album Catalog I think made by ARCSOFT or one of those little companies which is a simple search select and place with a keystroke or click, it organizes your tags, filters, dates or whatever the placement need be, then sorts into temp albums which you save (or change format .ext as you save) You end up viewing thumbnails only once or you can open up the photo and edit then save. Why go through all this madness? We have people, places and stuff to shoot, stories to tell...you all sound like computer programmer nerds given cameras! Sorry! I was given a camera a few months ago and look at me now! HAHAHAHA, laughing by myself, right?

Sep 19, 2007 4PM #

Flash Renamer would be my obvious choice. Can't live without it!


Jon C. Hodgson
Sep 19, 2007 4PM #

I'd like to correct your assessment of Photo Mechanic.

It definitely can do this. I shoot with multiple cameras and backup periodically throughout the shoot. This leaves me with a bunch of folders with nested sub-folder and sub-files, as well as naming conflicts since different cameras will use the same image number. I use PM to merge these into one big folder, all sorted by capture time (even though they come from different cameras).

The trick is that rather than use the rename feature, you need to use the "Ingest" feature. This has the ability to read from subfolders, output to a single flattened folder, while renaming using any combination of metadata fields from inside the files.

Here’s how you do this:

1. Modify the preferences to handle the situation where you have multiple frames in a single second for cameras with 10+ FPS. Goto “Edit…Preferences…Files” and change “Renaming resolution” to “Always append digits(01, 02, 03)”

2. To do the import, choose “File…Ingest” – Here’s the important settings:

* Ingest Folders - Add the base folder containing the 140 subfolders and then highlight it.

* Set “Source Directory Structure” to “ignore – copy all photos to same destination”

* Set “Filter Files” to “Copy Locked and Unlocked Photos” and “ Copy RAW and non-RAW Photos”

* Check “Rename Ingested photos as” and set to:

This will rename all files based on their capture date and time, to the second. Some cameras also support a sub-second timestamp, in which case you can use {ssec} as well. The trailing dash is simply a separator for the digits PM will automatically add if there are multiple frames from the same second. You can obviously change “Job” to whatever unique descriptor you want.

* Click “Ingest”
PM will then files all the files under the base folder, rename them according to the pattern specified, and save them all in a single destination folder.

Now that the source files are flattened and sorted by capture date/time, if you still must have the files named 1 through 13,000 you can then use the regular rename function:

* In the main PM window, set “Sort by” to “Capture Time”
* Select all files
* Choose “File…Rename”
* Set the photo renaming string to “Job-{seqn}”
* Press “Set {seqn variable}” and and set the value to “00001” to give you enough padding for 13,000 photos
* Click OK to rename all the photos.

Voila! You’ll have 13,000 photos names 00001 thru 13000 in capture time order.

Here’s proof that this works.

D:\Source\Folder 1\Folder 1a\IMG_0039-Canon EOS 30D.CR2
D:\Source\Folder 1\Folder 1a\IMG_0039-Canon EOS 30D.XMP
D:\Source\Folder 1\Folder 1a\IMG_0046-Canon EOS 5D.CR2
D:\Source\Folder 1\Folder 1a\IMG_0046-Canon EOS 5D.XMP

D:\Source\Folder 1\Folder 1b\IMG_0066-Canon EOS 30D.CR2
D:\Source\Folder 1\Folder 1b\IMG_0066-Canon EOS 30D.XMP

D:\Source\Folder 2\IMG_0071-Canon EOS 5D.CR2
D:\Source\Folder 2\IMG_0071-Canon EOS 5D.XMP

D:\Source\Folder 3\IMG_0074-Canon EOS 30D.CR2
D:\Source\Folder 3\IMG_0074-Canon EOS 30D.XMP
Total Files Listed:
76 File(s) 412,443,498 bytes

C:\Destination\Job Name\Job-20080314-083235-1.CR2
C:\Destination\Job Name\Job-20080314-083235-1.XMP
C:\Destination\Job Name\Job-20080314-083302-1.CR2
C:\Destination\Job Name\Job-20080314-083302-1.XMP

C:\Destination\Job Name\Job-20080314-123436-2.CR2
C:\Destination\Job Name\Job-20080314-123436-2.XMP
Total Files Listed:
76 File(s) 412,443,498 bytes

- Advertisement -
Please note all comments are reviewed by the blog moderator before posting.