Delete keywords that contain specific string

Started by Al_Bundy, November 26, 2020, 12:06:30 PM

Previous topic - Next topic

Al_Bundy

Hello Exif Community,

my images contain a lot of keywords in xmp-files (xmp:subject).

I would like to delete all keywords that contain a specific string using the exiftool.

Example:
Contained keywords: abc_1, abc_2, abc_3, cde_1, cde_2, cde_3

Keywords to be deleted: abc_1, abc_2, abc_3
Keywords to be obtained: cde_1, cde_2, cde_3

So far I am at the following command:

exiftool 'dir/file.xmp' -overwrite_original -m -'xmp:subject-=~ /abc/' -if '$xmp:subject =~ /abc/'

Unfortunately it does not work.

Do you have an idea?

Thanks for your support.

Al

StarGeek

Try
exiftool 'dir/file.xmp' -overwrite_original -m -sep ',' -if '$xmp:subject =~ /abc/' '-Subject<${Subject@;$_=undef if m/abc/}'

* 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).