I'm trying to return a list of files that have a value in the keyword field, ignoring files with no keywords, for output to CSV. What do I put between slashes to signify a field has a value? Thanks so much.
exiftool -if "$keywords =~ /?/i" -keyword -csv "C:\Scan_Location" -r "C:\Output.csv"
If the Keywords tag exists and has entries, then you can simply use
-if "$Keywords"
There are two edge cases where this will fail though, but they would be rare. First is if Keywords exists but only contains one entry which is a empty string. The second would be if it contains one entry with a value of the number 0. That is because Perl would regard both of these as False.
Alternatively, you could use
-if "defined $Keywords"
which will only fail if Keywords does not exist.
Excellent, thanks so much!