Can your rename raw and xmp sidecar files in one pass?

Started by Louie Sherwin, May 04, 2010, 08:36:20 PM

Previous topic - Next topic

Louie Sherwin

Hi, I needed to rename a bunch of raw files with their associated xmp sidecar files. A search on this forum gave me this topic  How to rename sidecar files? It looks like the content was truncated by the conversion from the cpan forum but I was able to figure out the basic idea of using -tagsfromfile.

Here is the command I used and the output. There were three pairs of RAW and xmp files in the E500/ directory.

exiftool -tagsfromfile %d%f.ORF -d "%%dsherwin_%Y%m%d_%%-4f.%%e" "-filename<datetimeoriginal" E500/

Error: Error opening file - E500/sherwin_20071216_1474.ORF
Error: Error opening file - E500/sherwin_20071216_1475.ORF
Error: Error opening file - E500/sherwin_20071216_1476.ORF


Looks like it renamed the .ORF files first then failed to find the old .ORF file when trying rename the .xmp file. I tried again this time using -ext in the command in the hopes that this would force the order of processing but got the same result.

exiftool -ext xmp -exp orf -tagsfromfile %d%f.ORF -d "%%dsherwin_%Y%m%d_%%-4f.%%e" "-filename<datetimeoriginal" E500/

I solved the problem by running first with -ext xmp and then -xmp orf. I was wondering if there was a way to order the processing of input files to make sure that the source file of the -tagsfromfile would always be process last.

tks, louie

[edit] PH - updated archive link to new fixed version of the post
MacOS 10.5.8, IIP 3, Lightroom 3b2, Photoshop CS4

Phil Harvey

Hi Louie,

I've fixed the formatting of the archived post, thanks for pointing this out.

Interesting problem.  There is no general way to delay processing of the -tagsFromFile files until after the others.  However, in your case the -fileOrder option will allow you to do what you want.  Try -fileOrder -filename to sort the files reverse alphabetically by filename.  This will cause the XMP files to be processed first.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).