Hello,
I understand I can append text to a field using exiftool, however is it possible to append text at a certain point in a field.
For instance, the caption field reads:
CARDIFF, WALES - MARCH 1: XXX March 1, 2020, in Cardiff, Wales.
And I would like to insert text at the point where XXX is
I initially thought it might be possible to 'offset' the start to account for the characters before (city and date) but this text will change from picture to picture.
Is there possibly a way of substituting matched text?
Thanks in advance,
Matt
This can be done with the Advanced formatting feature (https://exiftool.org/exiftool_pod.html#Advanced-formatting-feature), which is basically just a bit of Perl code inside the tag name. It is most commonly done with a RegEx (Regular Expression) substitution. There is this example (https://exiftool.org/exiftool_pod.html#exiftool--Description-FileName-s-.-.-dir) in the docs and it is one of the most common questions on this forum. You can find more examples with this Google search (https://www.google.com/search?q=site%3Aexiftool.org+regex+%22s%2F%22).
Using your example your command would be along these lines
exiftool "-Description<${Description;s/: XXX/: new word XXX/}" file.jpg
That is incredibly helpful. Thank you!