Flattening Keyword Hierarchi

Started by Pineapple, December 07, 2016, 08:17:06 AM

Previous topic - Next topic

Pineapple

Hi,

Can someone help/provide a script to flatten a Keyword Hierarchy. e.g.  Landscape|Forests|Trees and convert into Landscape, Forests, Trees. 

Basically I am trying to create individual keywords of each level in the hierarchy.

Thanks for your help,

Phil Harvey

Try this:

exiftool "-subject<${hierarchicalsubject;s/\|/, /g}" -sep ", " FILES_AND_OR_DIRS

This assumes you are starting from HierarchicalSubject and want to write XMP Subject based on this.

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