Keyword replacement while using -sep

Started by ekkidee, May 27, 2019, 02:15:20 PM

Previous topic - Next topic

ekkidee

Hi, can you check on something?

I have a bunch of files with improperly written keywords. Example: I have one keyword that reads

mexico;yucatan;casa;abeja;mailbox;casa abeja;wall;stone;

when in fact I want an individual keyword for each of those terms separated by semicolon. That was my fault for not fully understanding how keywords are handled. So now I've figured out how to fix it and I've come up with -

exiftool -keywords="mexico;yucatan;casa;abeja;mailbox;casa abeja;wall;stone;canon;powershot;sd1200" -sep ";" filename

but instead of replacing the original keyword as expected, what happens is that the new keywords (properly split as per -sep) are appended to the erroneous original.

That seems contrary to expectations; the -keyword= option I would expect to zap anything already in place, regardless of any -sep modifier. This also happens if I choose a character other than semi-colon.

There are workarounds of course; I can make first pass to delete them all, then add the ones I really want. But I thought you might be interested?

Thanks!

StarGeek

It works correctly here
C:\>exiftool -P -overwrite_original -keywords="mexico;yucatan;casa;abeja;mailbox;casa abeja;wall;stone;" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -g1 -a -s -keywords y:\!temp\Test4.jpg
---- IPTC ----
Keywords                        : mexico;yucatan;casa;abeja;mailbox;casa abeja;wall;stone;

C:\>exiftool -P -overwrite_original -keywords="mexico;yucatan;casa;abeja;mailbox;casa abeja;wall;stone;canon;powershot;sd1200" -sep ";" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -g1 -a -s -keywords y:\!temp\Test4.jpg
---- IPTC ----
Keywords                        : mexico, yucatan, casa, abeja, mailbox, casa abeja, wall, stone, canon, powershot, sd1200

C:\>exiftool -g1 -a -s -keywords y:\!temp\Test4.jpg -sep ##
---- IPTC ----
Keywords                        : mexico##yucatan##casa##abeja##mailbox##casa abeja##wall##stone##canon##powershot##sd1200


What are you using to view the keywords?  Have you checked the contents of XMP:Subject and possibly XPKeywords?  If you're checking Windows Properties->Details, then you need to double check the other two tags as Windows will combine all three of those when it displays the properties.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

ekkidee

Interesting. I am only using exiftool here. But now that I've fixed everything, I had another go at it, and cannot get it to repeat.

1) exiftool -keywords="this;is;a;test;" file.jpg
    1 image files updated

2) exiftool -T -filename -keywords file.jpg
file.jpg   this;is;a;test;

3) exiftool -keywords="this;is;a;test;" -sep ";" file.jpg
    1 image files updated

4) exiftool -T -filename -keywords file.jpg
file.jpg   this, is, a, test


which is as expected. Chances are it was a -keywords tag in one of the other groups. So sorry for the false alarm.