Wildcards in file names

Started by Skippermark, December 05, 2012, 11:18:49 PM

Previous topic - Next topic

Skippermark

I've tried for awhile to get the command line working for what I want, but I had no luck and thought I'd ask for help.

I have my photo editor set to export edited RAW files as TIFFs, but it doesn't include any EXIF info with the TIFFs.  I'm trying to copy the EXIF info out of the original RAW files into the newly edited TIFFs and can get it to work perfectly when I specify the filenames of the files individually with a command line like "exiftool -TagsFromFile image001.orf -All:All -overwrite_original image001.tif", but I'd like to be able to set it up to do a whole folder automatically in one quick batch.  I usually keep the RAW/TIFF files in the same folder while I'm editing them and won't move them until I'm done editing them later in my workflow.

I've tried:
exiftool -TagsFromFile *.orf -all:all -overwrite_original *.tif

and

exiftool -TagsFromFile %%f.orf -all:all -overwrite_original %%f.tif

plus some others, but they all fail with errors.  I just can't seem to get it right and hoping someone can offer some advice.  Thank you!

Phil Harvey

You're getting close.  Try this:

exiftool -tagsfromfile %d%f.orf -all:all -overwrite_original -ext tif DIR

(where DIR is the name of the directory with the images, or "." for the current directory)

You can add a -r option to also process sub-directories.

- 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 ($).

Skippermark

Thank you, Phil, for the super, quick reply!  It works perfectly when I enter the commands manually on the command line, but if I try to run them from a batch file, I get the error "File 'f.orf' does not exist for -tagsFromFile option".

For testing, the image files, batch file and ExifTool are all in the same directory.  My command prompt is also inside that directory when I'm running the batch file.  My batch file contains the exact same thing I type in on the command line when it works.

exiftool -tagsfromfile %d%f.orf -all:all -overwrite_original -ext tif "/Users/Test User/Desktop/exif/"

Basically, I want to be able to manually (using the command prompt) go into the directory with my images and run the batch file and ExifTool do its thing.  I realize once the batch file is working I'll have to copy it into a directory that's in my PATH.  Any thoughts of why it wouldn't be working now, however?  Thank you again for the quick reply.

Editing to add that the same thing happens if I use the . in place of the full path name.

Phil Harvey

Sorry, I forgot you were running from a .BAT file.  In a .BAT, you must double all of the "%" characters in the command:

exiftool -tagsfromfile %%d%%f.orf -all:all -overwrite_original -ext tif DIR

- 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 ($).

Skippermark

Wow.  Thank you so much for the quick reply.  That did the trick!  Have a great day.