Author Topic: Including namespace in JSON keys  (Read 324 times)

Retrography

  • Newbie
  • *
  • Posts: 9
Including namespace in JSON keys
« 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:

Code: [Select]
<XMP-prism:DOI>10.1016/j.jtemb.2017.11.012</XMP-prism:DOI>
We get the following JSON line (with -G):

Code: [Select]
"XMP:DOI": "10.1016/j.jtemb.2017.11.012"
Is there a way to obtain the following?

Code: [Select]
"XMP-prism:DOI": "10.1016/j.jtemb.2017.11.012"
Thanks

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14733
    • ExifTool Home Page
Re: Including namespace in JSON keys
« Reply #1 on: April 02, 2019, 09:44:45 AM »
Add -G1 instead of -G.

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

Retrography

  • Newbie
  • *
  • Posts: 9
Re: Including namespace in JSON keys
« Reply #2 on: April 02, 2019, 09:53:24 AM »
Amazing!

Thanks.