ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: EBAH on October 06, 2013, 01:47:57 AM

Title: [SOLVED] Renaming files with multiple metadata
Post by: EBAH on October 06, 2013, 01:47:57 AM
Hi,
I'd like to rename my pictures the following way:
An output example:

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
Title: Re: Renaming files with multiple metadata
Post by: EBAH on October 06, 2013, 02:41:18 AM
Just updated to:
Same behaviour.

Evan
Title: Re: Renaming files with multiple metadata
Post by: EBAH on October 06, 2013, 05:47:40 AM
WOAH!

exiftool -v5 '-filename<${DateTimeOriginal}_${Make}.%le' -d "%Y%m%dT%H%M%S" image.jpg
Title: Re: [SOLVED] Renaming files with multiple metadata
Post by: Phil Harvey on October 06, 2013, 06:59:02 AM
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
Title: Re: [SOLVED] Renaming files with multiple metadata
Post by: EBAH on October 06, 2013, 07:18:39 AM
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