ExifTool > Archives

Question: replace keyword


[Originally posted by peterlustig on 2010-03-19 12:30:03.968209-07]

Dear community,

I am trying to replace a certain keyword by another. Based on the application documentation I try

--- Code: ---exiftool -if '$keywords =~ "03_Vortag"' -keywords-="03_Vortag" -keywords+="Vortag"
alternatively also

--- Code: ---exiftool -if '$keywords =~ /03_Vortag/' -keywords-="03_Vortag" -keywords+="Vortag"
but it does not work. I only get "files failed condition". The keyword "03_Vortag" that should be replaced is
a) not present in all files, which is why I need the if-condition (otherwise I end up with the keyword "Vortag" in all files
b) only one keyword among others.

Would be great if anyone could give me a clue what I am doing wrong?



[Originally posted by exiftool on 2010-03-19 18:01:43.099657-07]

Hi Peter,

What system are you using? What you have done will work provided
that you are on Mac or Linux.  If you are on Windows, you need
to swap the single and double quotes in the -if expression.

Also, you need to specify a filename, but hopefully that is obvious.

One more note:  The -if condition will pass if any keyword
contains the string "03_Vortag", but the matching tag will only be
deleted if it is exactly "03_Vortag".  This probably isn't a concern,
but just to warn you that keywords like "003_Vortag" will match but
won't get deleted.

- Phil

[Originally posted by peterlustig on 2010-03-21 02:17:07.888795-07]

GREAT, thanks so much!

Yes, I am working on Win, and switching single and double quotes did the trick. Really great getting your help so quick, thank you!


[0] Message Index

Go to full version