ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: luvnrocs on March 01, 2017, 02:42:57 PM

Title: Append text to already existing tag
Post by: luvnrocs on March 01, 2017, 02:42:57 PM
I need to take a tag like IPTC:Source, which already contains info from Bridge, and add a string of text to that tag rather than replacing what is already there. I have tried playing with the < + syntax but just can't seem to get it right.

I am running this as a bat file along with other tags:

exiftool -creator="Digitized by MIT Libraries Scanning Lab" -source=", Massachusetts Institute of Technology, Institute Archives and Special Collections, Cambridge, MA" -xmp:subject="MIT" -transmissionreference="2017.005RR" -m -r -ext .TIF -overwrite_original -ext .PDF %1
Title: Re: Append text to already existing tag
Post by: Phil Harvey on March 01, 2017, 02:53:18 PM
The ExifTool "+=" operation isn't used to append text.  Try this:

exiftool "-iptc:source<${iptc:source} some extra text" FILE

- Phil
Title: Re: Append text to already existing tag
Post by: luvnrocs on March 01, 2017, 03:23:13 PM
That worked great.

Now I've got another issue. I tried doing the same thing to IPTC:keywords and when I run the bat file I get a "File not found" error

"iptc:keywords<${iptc:keywords}, MIT"
Title: Re: Append text to already existing tag
Post by: StarGeek on March 01, 2017, 03:28:43 PM
Keywords is a different type of tag.  This is the case where you would want to use +=.  So you would add "-iptc:keywords+=MIT".  You would do this for each keyword you want to add.  See FAQ 17 (http://www.exiftool.org/faq.html#Q17) for more info.

The reason you were getting a file not found error is because you didn't have a dash at the beginning of of your tag operation in your example.  So exiftool was looking for a file named iptc:keywords<${iptc:keywords}, MIT
Title: Re: Append text to already existing tag
Post by: luvnrocs on March 01, 2017, 04:01:18 PM
Thank you Phil! You're a life saver.
Title: Re: Append text to already existing tag
Post by: Phil Harvey on March 01, 2017, 09:31:58 PM
(and thanks StarGeek!)
Title: Re: Append text to already existing tag
Post by: luvnrocs on March 03, 2017, 06:01:27 PM
Yes Thank you StarGeek!