ExifTool Forum

ExifTool => Newbies => Topic started by: Pineapple on December 07, 2016, 08:17:06 AM

Title: Flattening Keyword Hierarchi
Post by: Pineapple on December 07, 2016, 08:17:06 AM
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,
Title: Re: Flattening Keyword Hierarchi
Post by: Phil Harvey on December 07, 2016, 08:22:46 AM
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