Copy and Rename with Model and DateTime

Started by dream_th, August 20, 2015, 03:36:12 PM

Previous topic - Next topic

dream_th

exiftool.exe -d %Y%m%d_%H%M%S%%-c.%%le "-filename<${Model}_${CreateDate}" "-filename<${Model}_${DateTimeOriginal}" -r -F
exiftool.exe -d dummy/%Y/%m "-directory<CreateDate" "-directory<DateTimeOriginal" -r

Is it possible to have the above commands in one line? The problem i'm having when i try putting in one line is that when i use "-filename<${Model}_${DateTimeOriginal}" together with -d %Y/%M/%Y%m%d_%H%M%S%%-c.%%le then the Model name is put in front of the full path and not in front of the filename
Real example:
%exiftool% -d dummy\%Y\%m\%Y%m%d_%H%M%S%%-c.%%le "-testname<${Model}_${DateTimeOriginal}" -r 10050808
'10050808/DSC03764.JPG' --> 'ILCE-5000_dummy/2015/08/20150808_155250.jpg'

Instead i want it to be dummy/2015/08/ILCE-5000_20150808_155250.jpg

Bonus option i would want is that if (and i had a few) a file does not have DateTimeOriginal use another date like CreateDate?

Thanks

Phil Harvey

Quote from: dream_th on August 20, 2015, 03:36:12 PM
Is it possible to have the above commands in one line?

This has come up a number of times.  If you want two different date/time formats with a tag value in the middle, then the easiest thing to do is to use two commands.  You can use the -execute option to launch exiftool only once, but each file will still get processed twice.

The alternatives are not trivial:

1) Format one of the date/time values yourself using the advanced formatting feature.

or

2) Create a user-defined tag to do exactly what you want.

To fall back to another date/time tag if DateTimeOriginal doesn't exist, just duplicate the copy options using the fallback tag, and put these first on the command line (the last valid copy will override earlier ones).

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