I came across this:
http://www.exiftool.org/index.html#filename
exiftool "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" DIR
using CreateDate to change the file name.
What if I wanted to use CreateDate, Make, CameraModelName for the file name?
Looks something like:
DCI00567.jpg to 20170221-135602-Sony-NEX-6N.jpg
Thank you very much!!!
This thread (https://exiftool.org/forum/index.php/topic,5079.0.html) discusses exactly what you want to do.
I recommend the semicolon after Make and Model to remove illegal characters from the file name.
- Phil
Thanks Phil! Exactly what I needed.
I tried this:
exiftool -P -d '%Y-%m-%d %H.%M.%S' \
'-filename<${DateTimeOriginal}_${Make;}.%e' \
'-filename<${CreateDate}_${Make;}_${Model;}.%e' \
'-filename<${DateTimeOriginal}_${Make;}_${Model;}.%e' \
$@
Is it correct that if all tags are available a file will get renamed three times?
I need to run this on about 20,000+ files. Is there a way I can speed things up a bit? e.g. by using -if? so that if DateTimeOriginal, Make and Model are all available, only the last line will be executed and the file will only get renamed once?
No need to try to be smarter than ExifTool; the rename is only done once :)
As Hayo said.
The last valid assignment takes precedence. (eg. if DateTimeOriginal, Make and Model exist, then the first two assignments are ignored.)
- Phil