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