ExifTool Forum

ExifTool => Newbies => Topic started by: Al_Bundy on April 15, 2020, 01:44:25 AM

Title: hierarchical tags generated from other tags
Post by: Al_Bundy on April 15, 2020, 01:44:25 AM
Hi,

I have supplemented photos with information about city and country.

Now I want to add this information in the form of keywords to the photos - that works too, I just can't get the compound hierarchical keywords right.

Tags to use:
IPTC:City
XMP:State
XMP:Country

Since I have a keyword hierarchy with several main groups (occasion, persons, etc) these keywords should be sorted in the main group "place

A hierarchical keyword in the following format should be published:
"place|land|state|city".

I would like to map this to a command line that executes the command for each image in a directory.

Probably the solution is quite simple, I just can't find it...

I am using ExifTool on Mac in the Terminal.

Thanks for your support

Al
Title: Re: hierarchical tags generated from other tags
Post by: Phil Harvey on April 15, 2020, 07:10:36 AM
Hi Al,

Something like this may do what you want:

exiftool '-hierarchicalsubject<$country|$state|$city' FILE

If you really need to, you can specify the groups:

exiftool '-hierarchicalsubject<$xmp:country|$xmp:state|$iptc:city' FILE

- Phil
Title: Re: hierarchical tags generated from other tags
Post by: StarGeek on April 15, 2020, 11:44:14 AM
I think they want this to be under the root word Place, so
exiftool '-hierarchicalsubject<Place|$country|$state|$city' FILE

Though I believe someone recently had a case where the program wasn't reading HierarchicalSubject but instead read the hierarchy from the Subject tag instead.