Add subjects (or keywords) from one file to another

Started by khargy, November 19, 2017, 12:40:55 PM

Previous topic - Next topic

khargy

I can't figure out the syntax to add subjects from one file to another without overriding the ones in the destination file...

I tried this:

exiftool -addTagsFromFile "sourceFile.xmp" -xmp:subject "destFile.xmp"

and that overrides all the subjects in the destination file

Phil Harvey

I admit this can be a bit confusing, but it is done like this:

exiftool -tagsFromFile "sourceFile.xmp" "-xmp:subject+<xmp:subject" "destFile.xmp"

The -addTagsFromFile option is to add to the new tags queued for writing, not to add to the existing tags in the 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 ($).

khargy

Cool that seems to work but I'm getting the following error:

Warning: Shift value for XMP-pdf:Subject is not a number - Source_File.JPG

Phil Harvey

Right.  You can avoid this warning by further qualifying your tag:

exiftool -tagsFromFile "sourceFile.xmp" "-xmp-dc:subject+<xmp-dc:subject" "destFile.xmp"

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

khargy

Great. Thanks for the help... I've been using ExifTool for many years and I still feel like I've just barely scratched the surface :)