Hi,
I am trying to move photos to directory and to subdirs - directory is date the picture was taken and subdir name of model of camera (Date/ModelName/*.jpg).
exiftool -d "%Y-%m-%d" "-directory<datetimeoriginal" *.jpg
This move pictures to Date/.
The problem is: how to use ${model}? Can anybody help me?
exiftool -d "%Y-%m-%d" "-directory<$datetimeoriginal/${model;}" -ext jpg .
Here I have added a filter on the model string to remove illegal characters (see the explanation of the advanced formatting feature in the -p section of the application documentation). Also, the above quoting is for Windows. Use single quotes instead on Mac/Linux.
- Phil
Thank you.
Is it possible in one cmd to move files to direcoty as above and also rename like this:
(from batch file)
exiftool -d "%%Y%%m%%d_%%H%%M%%S%%%%-.2nc.%%%%e" "-filename<$datetimeoriginal" -ext jpg .
I mean combination of moving to directory $datetimeoriginal/${model;} and renaming -filename<datetimeoriginal?
It is not easy to insert the value of a tag in between fields of a formatted date/time value, but for what you want it can be done like this:
exiftool -d "%%Y%%m%%d_%%H%%M%%S%%%%-.2nc.%%%%e" "-filename<${datetimeoriginal#;s/ .*//;tr/:/-/}/${model;}/$datetimeoriginal" -ext jpg .
Here I have had to do the formatting of the directory name manually (using the advanced formatting feature) because the model name can not be embedded into the date/time format string. I have also doubled the % characters as you had done for use in a BAT file.
- Phil
It's complicated.
Big thanks.