Combining keyword tags

Started by JessStryker, January 29, 2013, 12:10:50 AM

Previous topic - Next topic

JessStryker

I'm trying to create an argument file that will combine the various keyword tags used by windows into a single XMP tag so I can import them into my wife's new MacBook.  Unfortunately she used both the Keyword and Subject tags to label her photos in XP.  I've spent two days searching for an answer and really have tried everything I can find or think of. 

I want to create a "XMP-dc:Subject" tag, and then add the current values from "EXIF:XPSubject" and "EXIF:XPKeywords" to it.

Here's what what makes sense to me, but I understand this doesn't work to prevent duplicate tags.  Is there any way to do this without running exiftool twice.

-XMP-dc:Subject < EXIF:XPSubject
-XMP-dc:Subject +< EXIF:XPKeywords

Thank you very much to anyone who can help.   :)

Phil Harvey

#1
This is a bit complicated and is discussed in FAQ 17, but basically what you need to do is this:

exiftool -addtagsfromfile @ '-xmp:subject-<xpsubject' '-xmp:subject+<xpsubject' '-xmp:subject-<xpkeywords' '-xmp:subject+<xpkeywords' FILE

This will preserve any existing keywords in XMP-dc:Subject, and add the new ones without duplication.  (Provided that there is only one keyword in XPSubject and XPKeywords, because these aren't list-type tags.)

- Phil

Edit: Fixed bad URL
...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 ($).

JessStryker

Unfortunately that didn't work.  I think there was a misunderstanding of my question.  I'm thinking I am trying to do something beyond exiftool's capabilities(?)

I'm trying to use an argument file (*.args) rather than long command line.  It appears that when using an argument file only the last value called gets entered into the tag.  It doesn't seem that there is a way to add multiple values to the xmp:subject tag, using a single command.  I can add single value to the tag by running exiftool once for each value added.  Is this just how it is?  I looked all through FAQ 17 and tried lots of different variations of almost every code sequence listed, but nothing worked.  -addtagsfromfile doesn't seem to work when placed in a *.args file. (?)

#for example this code:
-XMP-dc:Subject +< EXIF:XPAuthor
-XMP-dc:Subject +< EXIF:Copyright
-XMP-dc:Subject +< EXIF:XPSubject
-XMP-dc:Subject +< EXIF:XPKeywords
# end

When running this in a .args file, exiftool ignores all the agrument lines in the list except the last one, -XMP-dc:Subject +< EXIF:XPKeywords

Phil Harvey

Here is my command line as an argfile:

-addtagsfromfile
@
-xmp:subject-<xpsubject
-xmp:subject+<xpsubject
-xmp:subject-<xpkeywords
-xmp:subject+<xpkeywords


Give that a try.

(Note that it isn't significant that I'm using different group names... I'm just a lazy typist, and these should do the same thing.)

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

JessStryker

Thank you!  That solved it.  I was formatting the arguments like they were a command line rather than breaking them out onto separate lines.