how to escape blanks and commas in -CreatorContactInfo structure

Started by graemeNPS, June 13, 2016, 12:39:21 PM

Previous topic - Next topic

graemeNPS

how do I escape blanks and comma for the -CreatorContactInfo structure?

The following gives me various errors
...CiAdrExtadr=310 some Street West, Suite 666,CiAdrPcode=M5W 1E6,...

and the command I am using, with single quotes, renders those in the xmp data.  And still no comma.

this cmd:
C:\somedir\somewhere>exiftool -city=Toronto -country=Canada -state=Ontario -CreatorContactInfo="{CiAdrCity=Toronto,CiAdrCtry=Canada,CiAdrRegion=Ontario,CiUrlWork=www.northplains.com,CiAdrExtadr='310 some Street West Suite 666',CiAdrPcode='M5W 1E6',CiEmailWork=artdept@northplains.com,CiTelWork=1-416-345-1900}"  -Creator="Graeme Elliott" .\Toronto\t200000.jpg
    1 image files updated

renders this xmp:
<rdf:Description rdf:about=''
  xmlns:Iptc4xmpCore='http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'>
 
<Iptc4xmpCore:CreatorContactInfo rdf:parseType='Resource'>
   
<Iptc4xmpCore:CiAdrCity>Toronto</Iptc4xmpCore:CiAdrCity>
   
<Iptc4xmpCore:CiAdrCtry>Canada</Iptc4xmpCore:CiAdrCtry>
   
<Iptc4xmpCore:CiAdrExtadr>&#39;310 some Street West Suite 666&#39;</Iptc4xmpCore:CiAdrExtadr>
   
<Iptc4xmpCore:CiAdrPcode>&#39;M5W 1E6&#39;</Iptc4xmpCore:CiAdrPcode>
   
<Iptc4xmpCore:CiAdrRegion>Ontario</Iptc4xmpCore:CiAdrRegion>
   
<Iptc4xmpCore:CiEmailWork>artdept@northplains.com</Iptc4xmpCore:CiEmailWork>
   
<Iptc4xmpCore:CiTelWork>1-416-345-1900</Iptc4xmpCore:CiTelWork>
   
<Iptc4xmpCore:CiUrlWork>www.northplains.com</Iptc4xmpCore:CiUrlWork>
 
</Iptc4xmpCore:CreatorContactInfo>
</rdf:Description>

I would prefer to not have the &#39; entity, and would like a comma in
<Iptc4xmpCore:CiAdrExtadr>&#39;310 some Street West Suite 666&#39;</Iptc4xmpCore:CiAdrExtadr>
   

I would prefer to not have the &#39; entity, and retain the blank in
<Iptc4xmpCore:CiAdrPcode>&#39;M5W 1E6&#39;</Iptc4xmpCore:CiAdrPcode>
   

Phil Harvey

The structure documentation explains how to serialize structures for writing.  The command would be:

exiftool -CreatorContactInfo="{CiAdrCity=Toronto,CiAdrCtry=Canada,CiAdrRegion=Ontario,CiUrlWork=www.northplains.com,CiAdrExtadr=310 some Street West|, Suite 666,CiAdrPcode=M5W 1E6,CiEmailWork=artdept@northplains.com,CiTelWork=1-416-345-1900}" FILE

"|" is used as the character to escape

There is currently no way to avoid the translation of quotes into XML character entities in the serialized XMP values, but I don't think you want these quotes anyway (I have removed them from the command above).

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