ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: EvilUnicorn on November 19, 2022, 05:30:07 AM

Title: -Directory & - Filename in one command?
Post by: EvilUnicorn on November 19, 2022, 05:30:07 AM
With help I've gotten far enough to have two working commands that do perfectly what is needed. Now I have to admit that playing with this tool is getting quite fun and challenging. Especially to get more advanced commands working. So, absolutely not necessary but wondering: can I make these two commands into one, and if so what's wrong with what I'm trying. Most of the times the answer is simply in the excellent docs but I'm not seeing it.

1st:
exiftool -ext JPG (or -ext .RW2) -r -d '%Y/%m - %B' '-Directory<DESTDIR$CreateDate/${make} - ${model;}' SRCDIR

2nd:
exiftool -r -d '%Y%m%d-%H%M%%-c.%%e' '-filename<CreateDate' SRCDIR\*.RW2 or SRCSIR\*.JPG


Since I can't declare -d more than once, I think I need to 'reset' it. I've gotten to this so far:
exiftool -ext JPG -r -d '%Y/%m - %B' '-Directory<$CreateDate/${make} - ${model;}' -Filename<${createdate#;DateFmt("%Y-%m-%d_%H%M%S")}.%e' *.JPG

This results in too many errors ;-) Perhaps filename and directory shouldn't be combined?

Final challenge is: How to get the .JPG and .RW2 in its own folder structure? In other words how to specify two DESTDIR depending on the -ext tag?

Regards

Title: Re: -Directory & - Filename in one command?
Post by: Phil Harvey on November 19, 2022, 07:06:17 AM
You were very close.  I think you just missed one quote before the -filename argument:

exiftool -ext JPG -r -d '%Y/%m - %B' '-Directory<$CreateDate/${make;} - ${model;}' '-Filename<${createdate#;DateFmt("%Y-%m-%d_%H%M%S")}.%e' *.JPG

I also added a semicolon after "make" in case it contains illegal characters.

I think this should work, but I didn't have time to test it.

- Phil