Search by the number of meta-tags assigned

Started by jbionic, December 11, 2021, 02:57:41 AM

Previous topic - Next topic

jbionic

Hi all,

Lets say I have a bunch of meta-tagged jpg-files within a folder.
I need to somehow highlight / separate / output only the files that have 3 (or N) keywords (tags) assigned to each of them.
So I could later go through the list and see if I can add any more tags to make the files more easily searchable.
How do I do that?

Thanks.

Phil Harvey

This is one way to find the files with 3 keywords in XMP Subject:

exiftool -if "$subject and scalar(split /, /,$subject) == 3" -filename DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

jbionic

Thanks, Phil. How do I do the same thing for IPTC:Keywords as in the attached file?

Phil Harvey

I would have thought this should be obvious:  Change "subject" to "keywords" in 2 places in the command.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).