Author Topic: Append text to already existing tag  (Read 2086 times)

luvnrocs

  • Jr. Member
  • **
  • Posts: 15
Append text to already existing tag
« 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:

Code: [Select]
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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15224
    • ExifTool Home Page
Re: Append text to already existing tag
« Reply #1 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
...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 ($).

luvnrocs

  • Jr. Member
  • **
  • Posts: 15
Re: Append text to already existing tag
« Reply #2 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

Code: [Select]
"iptc:keywords<${iptc:keywords}, MIT"

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2838
Re: Append text to already existing tag
« Reply #3 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 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
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

luvnrocs

  • Jr. Member
  • **
  • Posts: 15
Re: Append text to already existing tag
« Reply #4 on: March 01, 2017, 04:01:18 PM »
Thank you Phil! You're a life saver.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15224
    • ExifTool Home Page
Re: Append text to already existing tag
« Reply #5 on: March 01, 2017, 09:31:58 PM »
(and thanks StarGeek!)
...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 ($).

luvnrocs

  • Jr. Member
  • **
  • Posts: 15
Re: Append text to already existing tag
« Reply #6 on: March 03, 2017, 06:01:27 PM »
Yes Thank you StarGeek!