Hey Phil
Can you help me with command to remove selective IPTC keywords? So for example if I have a set of 2000 images with 400 of them having a particular keyword "System", I would just like to remove the Keyword system so that 400 images turn without any IPTC keywords whereas remaining 1600 retain the Keywords.
PS: I am using ExifTool GUI. Direct command for that will help best please.
Thanks
Amit
Hi Amit,
I think this is the command you want:
exiftool -keywords-="System" DIR
where DIR is the directory containing the images.
In ExifTool GUI direct, you should leave off the "exiftool" and directory specification.
- Phil
Thanks Phil
Seems they are added in XPKeywords as well. Will this work to remove them from XPKeywords? Did not work for me :(
exiftool -XPKeywords-="System" DIR
No. XPKeywords is not a list-type tag.
You must do something like this instead to edit the string value:
exiftool "-xpkeywords<${xpkeywords;s/( ,)?System( ,)?//}" ...
This removes "System" from the string, and any leading or trailing ", " delimiters.
- Phil
Phil this is not working for me. It is instead adding s/( as a new keyword.
What version of ExifTool are you using? This feature was added in version 9.15.
- Phil
Edit: Also, I got the delimiters wrong. This is a bit trickier than I thought. Try this:
exiftool "-xpkeywords<${xpkeywords;s/^System, //;s/, System$//;s/, System, /, /}" -xpkeywords-=System ...
This handles the keyword at the start, end, or middle of the string properly, and deletes XPKeywords if it is the only keyword.
I am using latest, 9.53
System is the only keyword. There are no other keywords for same file and I want to remove System.
Oh. Then simply -xpkeywords-=System should work.
I need more details to figure out the problem. This is what I get:
> exiftool a.jpg -xpkeywords
XP Keywords : System
> exiftool a.jpg -xpkeywords-=System
1 image files updated
> exiftool a.jpg -xpkeywords
>
- Phil
Worked like a charm. Thanks :)
OK, so what changed? You tried exactly this in a previous post.
- Phil
Yes, seems updating the Exiftool version helped.
Something new here - My IPTC keywords are being shown as keyword1*keyword2 whereas in XPKeywords they are shown as Keyword1;Keyword 2. Is there a way I can have them as
IPTC
Keywords: Keyword1
Keywords: Keyword2
Thanks
Amit
No, sorry. But you can change the IPTC Keywords delimiter to whatever you want with the -sep option.
- Phil