Hi all,
how can I list all files with a certain keyword, but not keywords containing the desired keyword?
-if "$Keywords =~ /foo/" triggers also on foobar or afoo, but I'm looking only for "foo".
TIA,
Oliver
Try this
exiftool -sep "##" -if "$Keywords=~/(##|^)foo($|##)/" /path/to/files/
thanks for the quick help! I'm a bit out of practice, should have found that out on my own...
exiftool -sep "," -if "$Keywords=~/(,|^)foo(,|$)/" is even better because it doesn't restrict the keywords not to contain ##.
But of course you have to make sure that your keywords don't include a comma. I always chose ## because a double hashtag seems to me to be an unlikely part of a keyword, but a comma can show up in something like "Smith, John".
It all depends upon your data set, which you would best know what it contains. And you're not limited to only 1 or 2 characters. A longer random string would also work, such as "68eCud8VaB", 8675309, or ETPhoneHome.
correct. I thought that comma is a fixed delimiter but it isn't.