ExifTool Forum

ExifTool => Newbies => Topic started by: jbionic on December 11, 2021, 02:57:41 AM

Title: Search by the number of meta-tags assigned
Post by: jbionic on December 11, 2021, 02:57:41 AM
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.
Title: Re: Search by the number of meta-tags assigned
Post by: Phil Harvey on December 11, 2021, 07:13:44 AM
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
Title: Re: Search by the number of meta-tags assigned
Post by: jbionic on December 11, 2021, 08:49:03 AM
Thanks, Phil. How do I do the same thing for IPTC:Keywords as in the attached file?
Title: Re: Search by the number of meta-tags assigned
Post by: Phil Harvey on December 11, 2021, 08:56:49 AM
I would have thought this should be obvious:  Change "subject" to "keywords" in 2 places in the command.

- Phil