Boolean logic in Exiftool

Started by ginger, October 09, 2018, 05:44:05 PM

Previous topic - Next topic

ginger

Hi everyone.

I would like a bit of help from you.
I know we can check several conditions with boolean OR in the following way:

exiftool  -if '$Caption-Abstract =~ /Word1|Word2|Word3/i'


How do we perform the following boolean expression (for the conditions of any exif tag)


(Word1 OR Word2) AND word3 and NOT word4


Many thanks!

StarGeek

Try
exiftool -if '$Caption-Abstract=~/Word1|Word2/i and $Caption-Abstract=~/Word3/i and $Caption-Abstract!~/Word4/i'
or
exiftool -if '$Caption-Abstract=~/Word1|Word2/i and $Caption-Abstract=~/Word3/i and not $Caption-Abstract=~/Word4/i'

!~ is the negative version of =~.  And you could always just use NOT if you like.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).