Problem with conditional writing

Started by MikeBlyth, January 28, 2018, 12:23:12 PM

Previous topic - Next topic

MikeBlyth

I'm sure I'm just missing something simple in syntax, but I'm not getting "write tag if empty" to work. If I use,

exiftool -description-="Napoleon" *.jpg

nothing happens.

On the other hand, if I write,

exiftool -description="Napoleon" -if "not $description" *.jpg

then the tag is updated. What am I doing wrong?

StarGeek

Your first example isn't conditional writing, it's conditional deletion.  From the docs:
"-= may be used to conditionally delete or replace a tag"

Instead, take a look at the -wm option.  From the docs there:
"use -wm cg to only create new tags (and avoid editing existing ones)."
* 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).