Append text to existing metadata tag
Added by Lucasp Paczkowski over 11 years ago
Hi, I am learning about Exiv2 and find it a very useful program. I use it in command prompt mode.
Quite often I need to append text to existing IPTC tags. Let’s say I have a photo with IPTC tag CountryName and its value equal to Europe. I would like to be able to append text to this tag without deleting its original value. So for example appending 'Poland':
Append Iptc.Application2.CountryName String "/Poland"
would result in tag value Europe/Poland
Currently Exiv2 has set/add/delete options which do not have append functionality. Can you please let me know if there is any way to append values to tags without overwriting its original value?
Replies (2)
RE: Append text to existing metadata tag - Added by Robin Mills over 11 years ago
Well, it's rather easy to do this with the command-line/bash shell in UNIX.
$ country=`exiv2 ... foo.jpg`
$ country="$country / Poland"
$ exiv2 ..... "$country" foo.jpg
And that can be combined into a single command, something like:
exiv2 .... "`exiv2 ... foo.jpg` /Poland" foo.jpg
If you're on Windows, you can install Cygwin to get bash. I'm not so sure that cmd.exe can do as easily - however I'm sure there's a fairly simple way.
On which platform are you using exiv2 ?
RE: Append text to existing metadata tag - Added by Lucasp Paczkowski over 11 years ago
Hi Rob, Thank you for your help. I use Windows. I can write a DOS batch to do what you suggesting. I was not sure which way to go. Thank again.
Lucas