[BUG] -SourceFile tag reported twce in csv output when listing tags and using -f

Started by dwegner, June 04, 2019, 06:33:59 PM

Previous topic - Next topic

dwegner

I'm using exiftool to pull specified tags out of a large number of image files and import them into a sqlite DB. When using the -f flag, it appears that the SourceFile tag is output twice. Here's a simplified example of the behavior:

CSV output with -SourceFile tag works as expected - the tag is output once:

./exiftool -ver -csv -SourceFile IMG_1075.JPG
11.48
SourceFile
IMG_1075.JPG

If you add the -f flag the column is repeated. This causes sqlite import of the resulting csv file to fail due to the duplicate column name. Also notice that the second value is incorrect:

./exiftool -ver -f -csv -SourceFile IMG_1075.JPG
11.48
SourceFile,SourceFile
IMG_1075.JPG,-

The workaround is to not specify the -SourceFile tag as it appears to be output by default even when listing other tags, but this is kind of unexpected behavior:

./exiftool -ver -f -csv -FileSize IMG_1075.JPG
11.48
SourceFile,FileSize
IMG_1075.JPG,4.2 MB


StarGeek

There is no tag named SourceFile.  It only exists in the CSV output (see -csv option, first paragraph).

If you run
exiftool -SourceFile IMG_1075.JPG
you will get no output, as there isn't anything to list.  The addition of the -f (ForcePrint) option forces exiftool to create output for this non-existent tag.  That's why you get a second column.
"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