Time range plus one or more tags as quailifer

Started by PlasticArmyGuy, April 28, 2025, 06:16:47 PM

Previous topic - Next topic

PlasticArmyGuy

I have been trying to us a time range for datetimeoriginal plus one other tag to selectively apply an entry to the Event tag.  For example: 

exiftool -r -if '($DateTimeOriginal ge "2024:01:27 18:59:00" and $DateTimeOriginal lt "2024:01:27 23:59:00" and $Make eq "Nikon Corporation")' -Event="Alice Ted Reception" *.jpg

As written the command does not work.  If I remove the and $Make eq "Nikon Corporation") section the command completes okay.

How would I restate the if condition to get this to work?  Can it be restated?

Thanks. 

StarGeek

It works correctly here after I swap the quotes for my Windows CMD
C:\>exiftool -G1 -a -s -DateTimeOriginal -make -event y:\!temp\Test3.jpg y:\!temp\Test4.jpg
======== y:/!temp/Test3.jpg
[ExifIFD]       DateTimeOriginal                : 2024:01:27 15:00:00
[IFD0]          Make                            : Nikon Corporation
======== y:/!temp/Test4.jpg
[ExifIFD]       DateTimeOriginal                : 2024:01:27 22:00:00
[IFD0]          Make                            : Nikon Corporation
    2 image files read

C:\>exiftool -r -if "($DateTimeOriginal ge '2024:01:27 18:59:00' and $DateTimeOriginal lt '2024:01:27 23:59:00' and $Make eq 'Nikon Corporation')" -Event="Alice Ted Reception" y:\!temp\Test3.jpg y:\!temp\Test4.jpg
    1 files failed condition
    1 image files updated

C:\>exiftool -G1 -a -s -DateTimeOriginal -make -event y:\!temp\Test3.jpg y:\!temp\Test4.jpg
======== y:/!temp/Test3.jpg
[ExifIFD]       DateTimeOriginal                : 2024:01:27 15:00:00
[IFD0]          Make                            : Nikon Corporation
======== y:/!temp/Test4.jpg
[ExifIFD]       DateTimeOriginal                : 2024:01:27 22:00:00
[IFD0]          Make                            : Nikon Corporation
[XMP-iptcExt]   Event                           : Alice Ted Reception
    2 image files read

What command line/OS are you using? Are you sure that the DateTimeOriginal and Make tags exist in the file?

What is the exact output from your command?
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

PlasticArmyGuy

#2
Dumb mistake on my part.  The Make value should have been in all caps i.e. NIKON CORPORATION in my command.

Thanks for replying.  Knowing the command should work basically lead me to my error.