Is it possible to use "OR" in "IF" statement?

Started by Tania, September 23, 2014, 07:17:52 PM

Previous topic - Next topic

Tania

Hello everyone! I want to check Caption-Abstract tag for several words. if either of them is present, I do some actions. Is it possible to do so? Right now I just check for each of the word in a new exiftool operation, but obviously it takes more time, because the file is scanned two times instead of one:
-if '$Caption-Abstract =~ /word1/i' ....
-if '$Caption-Abstract =~ /word2/i' ....

StarGeek

Try
-if '$Caption-Abstract =~ /word1|word2/i'

The part between the slashes is a Regular Expression and the bar is used for alternative options.  Check out this website for more info.
"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

Tania

Thanks so much! That was exactly something I've been looking for;)