ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: bourne on July 19, 2011, 08:37:25 AM

Title: Copy multiple tags into one
Post by: bourne on July 19, 2011, 08:37:25 AM
It must be simple, however, I seem to be unable to find it in the documentation.
What I achieved:
exiftool -tagsfromfile @ "-description<title" test.jpg
exiftool -tagsfromfile @ "-description<country" test.jpg

Hence, I have either the title or the country in description. What I really want is a special description for Google+ consisting of
Description = Title, Country (Creator)     ( including, and () )

I already fail at the next step:
exiftool -tagsfromfile @ "-description<title" "-description<country" test.jpg
exiftool -tagsfromfile @ "-description+<title" "-description+<country" test.jpg
exiftool -addtagsfromfile @ "-description<title" "-description<country" test.jpg
exiftool -addtagsfromfile @ "-description+<title" "-description+<country" test.jpg

Could you please point me in the right direction - doc or examples?
Title: Re: Copy multiple tags into one
Post by: Phil Harvey on July 19, 2011, 08:44:57 AM
From the -tagsFromFile documentation (https://exiftool.org/exiftool_pod.html#item__2dtagsfromfile_srcfile_or_fmt):

           "An extension of the redirection feature allows strings involving
            tag names to be used on the right hand side of the "<" symbol with
            the syntax "'-DSTTAG<STR'", where tag names in STR are prefixed
            with a "$" symbol.  See the -p option for more details about this
            syntax.  Strings starting with a "=" sign must insert a single
            space after the "<" to avoid confusion with the "<=" syntax which
            would otherwise attempt to set the tag value from the contents of
            a file.  A single space at the start of the string is removed if
            it exists, but all other whitespace is preserved."

So something like this is what you want:

exiftool "-description<$title, $country ($creator)" test.jpg

(use double quotes as above in Windows, or single quotes on Mac/Linux)

Note that -tagsfromfile @ is implied when you copy tags with "<", so you can save some typing by leaving this out.

There is a similar example which sets Comment from EXIF:ISO and ShutterSpeed in the COPYING EXAMPLES (https://exiftool.org/exiftool_pod.html#copying_examples) .

- Phil
Title: Re: Copy multiple tags into one
Post by: bourne on July 19, 2011, 08:54:04 AM
Thank you very much!
I already tried $ earlier and received an error. However, you provided the solution: Single Quotes on Mac!