ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Matthias Juergens on December 03, 2019, 06:30:08 PM

Title: Multiple use of Date Format in an argfile
Post by: Matthias Juergens on December 03, 2019, 06:30:08 PM
Dear Harvey,
I love this tool! Thank you so much!

The following code works flawlessly.

exiftool -@ argfile -k

argfile:
-artist=Matthias Juergens
-FileName<${DateTimeOriginal}_${ModelShort}%-4f.%e
-d
F:\ORIGINAL.PHOTORECORDING\PHOTO.%Y\%Y%m%d-DE-/%Y%m%d_%H%M%S
D:\

this makes the following structure e.g.:

F:\ORIGINAL.PHOTORECORDING\PHOTO.2019\20190406-DE-/20190406_194513_ND3467.JPG

But, now I want to include the copyright section.
if I use something like
-copyright<©$createdate

the primarily defined "F:\FOR_SYNCHRON\ORIGINAL.PHOTORECORDING\PHOTO.%Y\%Y%m%d-DE-/%Y%m%d_%H%M%S" is written to the copyright tag.
That is correct but not that what I want.

Is there a way to set the copyright to
e.g. 2019 (year of createdate)

I fear that there are two definitions of the Date Format neccessary, but this is not possible, I think.

Best regards,
Matthias Juergens
Title: Re: Multiple use of Date Format in an argfile
Post by: StarGeek on December 03, 2019, 08:09:44 PM
What you want to use is the DateFmt helper function (https://exiftool.org/exiftool_pod.html#Helper-functions).  With it you can set a different date format for each tag.  You need to include the hashtag after the tag name (see the -n (printConv) option (https://exiftool.org/exiftool_pod.html/exiftool_pod.html#n---printConv)) because otherwise the -d (dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) will override it. For your copyright line use

-copyright<©${CreateDate#;DateFmt('%Y')}
Title: Re: Multiple use of Date Format in an argfile
Post by: Matthias Juergens on December 03, 2019, 11:34:05 PM
Hallo StarGeek,
:) :) :) :) :) :) :) :) :) :) Thank you so much. Works flawlessly!

Best regards,
Matthias