[SOLVED] Renaming files with multiple metadata

Started by EBAH, October 06, 2013, 01:47:57 AM

Previous topic - Next topic

EBAH

Hi,
I'd like to rename my pictures the following way:

  • DateTimeOriginal_Make.jpg
An output example:

  • 20130914T074335_Canon.jpg

To achieve this I tried the following:
exiftool "-FileName<DateTimeOriginal" -d "%Y%m%dT%H%M%S.%%le" myimage.jpg
And it works fine but the Make information is missing, so:
exiftool "-FileName=%f_${Make}.%le" 20130914T074335.jpg
But this doesn't work! I just get: 20130914T074335_.jpg
Make tag is present for sure:

exiftool -Make 20130914T074335.jpg
ExifTool Version Number         : 9.04
Make                            : Canon


Can it be an exiftool version issue?

Also, is there a way to merge in one command?
Something similar:
exiftool "-FileName<DateTimeOriginal_${make}.%le" -d "%Y%m%dT%H%M%S" myphoto.jpg

Thanks for your help and for the great tool!!!
Evan

EBAH

Just updated to:

  • ExifTool Version Number         : 9.37
Same behaviour.

Evan

EBAH

#2
WOAH!

exiftool -v5 '-filename<${DateTimeOriginal}_${Make}.%le' -d "%Y%m%dT%H%M%S" image.jpg

Phil Harvey

Hi Evan,

Glad you figured this out.  I might suggest adding a semicolon to filter out characters in the Make string that might be illegal in file names:  ${Make;}

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

EBAH

Thank you very much Phil,
the final command is:

exiftool '-filename<${DateTimeOriginal}_${make;tr/ /_/;s/__+/_/g}.%le' -d "%Y%m%dT%H%M%S" picture.jpg

and output example:

20130914T170119_NIKON_CORPORATION.jpg
20130914T170122_Canon.jpg


and works like a charm!  :D

Thanks again for exiftool!

Kind Regards,
Evan