Appending text to existing comment

Started by neebah, July 06, 2017, 11:09:58 PM

Previous topic - Next topic

neebah

Is there a way (I'm sure there is) to append text to an already exiting text tag like User Comment while leaving the original text behind. 

Hayo Baan

There could be a simpler way, but this would work:

exiftool '-tag<${tag; $_ .= " add this text"}' FILE

Replace tag with the tag you want to append the text to and switch the single and double quotes when on Windows.
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

@Hayo: No need to use an advanced formatting expression.  This is a bit simpler:

exiftool "-tag<${tag} add new text here" FILE

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

neebah

okay and if I wanted to add it to the beginning instead of the end I would do this ?

exiftool "-tag<add new text here ${tag}" FILE

Phil Harvey

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