ExifTool Forum

ExifTool => ExifTool GUI => Topic started by: Retrography on April 02, 2019, 09:35:21 AM

Title: Including namespace in JSON keys
Post by: Retrography on April 02, 2019, 09:35:21 AM
I have learned that I can extract the group names along with the tags in the JSON output using the -G switch. But is there any way that I get the namespace out as well? Note that after modifying the extracted tags I need to write them back to a file using exiftool, so it is important that the format is readable as input for exiftool.

More particularly, this is what I need:

Right now for the following XML/RDF line:

<XMP-prism:DOI>10.1016/j.jtemb.2017.11.012</XMP-prism:DOI>

We get the following JSON line (with -G):

"XMP:DOI": "10.1016/j.jtemb.2017.11.012"

Is there a way to obtain the following?

"XMP-prism:DOI": "10.1016/j.jtemb.2017.11.012"

Thanks
Title: Re: Including namespace in JSON keys
Post by: Phil Harvey on April 02, 2019, 09:44:45 AM
Add -G1 instead of -G.

- Phil
Title: Re: Including namespace in JSON keys
Post by: Retrography on April 02, 2019, 09:53:24 AM
Amazing!

Thanks.