Command to remove quotes from around keywords?

Started by emjaysea, May 11, 2020, 09:53:06 AM

Previous topic - Next topic

emjaysea

I've been using a now discontinued image server app, Gallery Server Pro, to host my images and to tag them, too, but I find that it's put quotes around the keywords, like this: "lake, Lake Michigan, swimming, fun, recreation, kids, summer day"  When I try to import the images into the new app I'm using, it only gets about the first four keywords and ignores the rest, unless I remove the quotes, then it sees them all and imports them.  I'm hopeful that someone will help me come up with a simple command line I can use in ExifGUI to remove all those quote marks before I import them into the new app.  Thanks for your assistance.

emjaysea

#1
Hey, I see that ExifGUI is no longer supported, sorry for asking this here, then, although to use the EXIFTool Direct option in the GUI, I believe you're just entering command line type commands. 

Having said that, I poked around some more and found this: "-keywords<$subject" -sep "//"  That seems to work!  Except it adds an extra space between the keywords as viewed from Adobe Bridge.  Is the extra space a big deal?  To be clear, the extra space is at the beginning of the keyword, so in Bridge it looks like this:  lake;  Lake Michigan;  swim;  fun;  recreation,  Bridge adds the semi-colons, not me, and ExifTool GUI displays the keywords like this: aspen* harvest* timber* lumber* forest* forestry* woods* trees* fall* autumn

Phil Harvey

I don't see how the command you gave solves your problem.  All it does is copy the XMP:Subject to IPTC:Keywords.  And it would be better to do it like this: "-keywords<subject" (see common mistake 5b)

But if the keywords are stored in XMP:Subject as a single string with ", " separating the words, then they can be split apart like this:  -tagsfromfile @ -subject -sep ", "

I can help more if you post an example of the file which gives the quotes around the keywords.

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

emjaysea

http://dnrmedia.org/misc/DSK161-01.jpg 

Thanks, I really appreciate it.

StarGeek

It looks like the main problem is that the keywords are not stored separately but as a single string. So in the example image, there is a single keyword consisting of
aspen, trees, forest, woods, forestry, late fall
instead of a list of individual keywords
aspen
trees
forest
woods
forestry
late fall


What you'll want to use in the GUI direct would be
-tagsfromfile @ -Keywords "-subject<Keywords" -sep ", "

This will correct the Keywords error and copy Keywords into Subject.
* 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).

emjaysea

Awesome, thanks!  Now how do I apply it to tens of thousands of files in hundreds of directories?  I'm guessing I'll have to use command line for that...

Really appreciate it, it appears to work perfectly.

Phil Harvey

On the command line:

exiftool -tagsfromfile @ -Keywords "-subject<Keywords" -sep ", " -r DIR

but instead of typing the directory name (represented by "DIR" in the above command), you can drag and drop the folder onto the cmd.exe window.

Also, the above command will leave "_original" files for each changed file as a backup.  Add -overwrite_original to the command if you already have backups.

And add -P to the command if you want to preserve the original filesystem modification time of each 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 ($).

emjaysea

Thank you, Phil, that works great, too.  This will literally save me a week of work, if not more.

emjaysea

And I should add for anyone reading this in the future, the quotes I was seeing was Adobe Bridge's interpretation of, "this series of words separated by commas is really just one keyword", which is what StarGeek helpfully pointed out.  When looking at the keywords in ExifToolGUI, there were no quotes.