Author Topic: Copy multiple tags into one  (Read 2794 times)

bourne

  • Newbie
  • *
  • Posts: 2
Copy multiple tags into one
« 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?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18006
    • ExifTool Home Page
Re: Copy multiple tags into one
« Reply #1 on: July 19, 2011, 08:44:57 AM »
From the -tagsFromFile documentation:

           "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 .

- Phil
« Last Edit: July 19, 2011, 08:51:23 AM by Phil Harvey »
...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 ($).

bourne

  • Newbie
  • *
  • Posts: 2
Re: Copy multiple tags into one
« Reply #2 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!