Author Topic: How to remove duplicate tags from supplementalCategories?  (Read 930 times)

stephanie

  • Newbie
  • *
  • Posts: 8
How to remove duplicate tags from supplementalCategories?
« on: January 13, 2017, 05:49:25 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 13886
    • ExifTool Home Page
Re: How to remove duplicate tags from supplementalCategories?
« Reply #1 on: January 13, 2017, 07:08:45 AM »
Hi Stephanie,

There are various ways to do this.

Here is a command by StarGeek to remove duplicate keywords from images

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