I know that if you use the -f option and specify a tag that does not exist, then it will print out a dash (-) by default for the value.
Is it possible to change the default value to empty string instead of dash? I have tried the following commands with the -api MissingTagValue option, but they don't output an empty string:
G:\Documents>exiftool -f -SubSecTimeOriginal -api MissingTagValue="" "h:\IMG_1833.jpg"
Sub Sec Time Original : -
G:\Documents>exiftool -f -SubSecTimeOriginal -api MissingTagValue= "h:\IMG_1833.jpg"
Sub Sec Time Original : -
G:\Documents>exiftool -f -SubSecTimeOriginal -api MissingTagValue='' "h:\IMG_1833.jpg"
Sub Sec Time Original : ''
This is the correct syntax:
-api missingtagvalue^=
The ^= is a special operator that allows you to assign an empty value. Otherwise simply = will delete the tag/option if a value isn't given.
- Phil
The caret is a special character under Windows, so you'll need to put it in quotes if that's your OS.
@StarGeek: Good point. Thanks. So:
-api "missingtagvalue^="
- Phil
Thanks guys!
On Windows, I found a few different ways to handle the caret.
-api "MissingTagValue^="
-api MissingTagValue"^"=
-api MissingTagValue"^="
-api MissingTagValue^^=