pls help on writing origin information as comment

Started by tomasherrmann, June 03, 2018, 04:46:02 PM

Previous topic - Next topic

tomasherrmann

hello,
my *.jpgs contain information about the origins (in ITCP´s "Sub-location"). This information should be placed in the comment field.
I tried a lot  in kind of

exiftool -comment=-Sub-location  src.jpg

but that is obviously wrong - (now the comment is: "-Sub-location" and not the contents of this field) - could you pls help?
thanx



StarGeek

You're close.  To copy a tag, you want to use the Greater/Less Than signs </>.  The equal sign assigns a static value.  Also, you only need the dash at the beginning, not on the second tag.

So your command would be:
exiftool "-comment<Sub-location" src.jpg

BUT

This probably won't do what you want it to do.  What program are you using to view "Comment".  If you are using Windows properties, then you actually want to use one of these tags:
EXIF:UserComment
XMP:UserComment
EXIF:XPComment


So try this instead:
exiftool "-XPComment<Sub-location" src.jpg

This command creates backup files.  Add -overwrite_original to suppress the creation of backup files.  Add -r to recurse into subdirectories. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

tomasherrmann

great, thank you very much!

surprisingly
exiftool" "-Comment<Sub-location" src.jpg
works with exiftool 3.5 under windows10

May I ask you now for a hint on combining two fields?

~~~ exiftool" "-Comment<Sub-location + " " + city" src.jpg

thank you

StarGeek

When copying more than one tag, you have to add a dollar sign in front of the tag name to treat it as a string.  Then you can just combine them with the space between them
exiftool "-comment<$Sub-location $City" src.jpg

If you wanted to add static text as well, you can just place it where you want.  As long as the text doesn't bump up against the end of a tag name, it should work
exiftool "-comment<Location: $Sub-location City: $City" src.jpg
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).