Author Topic: Can your rename raw and xmp sidecar files in one pass?  (Read 4159 times)

Louie Sherwin

  • Newbie
  • *
  • Posts: 6
Can your rename raw and xmp sidecar files in one pass?
« on: May 04, 2010, 08:36:20 PM »
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/

Code: [Select]
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
« Last Edit: May 12, 2010, 10:59:35 AM by Phil Harvey »
MacOS 10.5.8, IIP 3, Lightroom 3b2, Photoshop CS4

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18370
    • ExifTool Home Page
Re: Can your rename raw and xmp sidecar files in one pass?
« Reply #1 on: May 05, 2010, 07:39:18 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).