How to remove duplicate tags from supplementalCategories?

Started by stephanie, January 13, 2017, 05:49:25 AM

Previous topic - Next topic

stephanie

Hello Phil,

You already helped me a lot with exiftool. Thank You very much for this.

Now I have a new question about removing duplicate tags:

I have supplementalCategories tags as the following:

"Nature, Trees, Wood, Plants, Pine Trees"
"Trees, Plants, Leaf Trees, Trees"
"Plants, Trees, Nature, Trees, Wood"
"Leaf Trees, Trees, Plants, Trees, Nature, Wood"

And so on...

I want to delete all duplicates of the tag "Trees". But tags containing the word "Trees" (e.g. "Leaf Trees") shall not be deleted.

Which is the correct code to realize this?

Many greetings from

Stephanie

Phil Harvey

...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 ($).