SourceFile output for some files gets embedded within quotation marks (")

Started by U_turn, August 06, 2018, 05:45:41 PM

Previous topic - Next topic

U_turn

While trying to list all images with some tag set, I get most image filenames and paths in plain, but some are embedded within quotation marks ("). And I can't figure out the pattern or a cause for this behavior.  I see that it doesn't happen random, as the same image filenames and paths are always embedded. I would guess that it's because of space char in their filename or path, but not all filenames and paths with space char are embedded...

Used command:
exiftool.exe -charset FileName=cp1257 -r . -ext JPG -m -if "$sometag" -csv -sourcefile


StarGeek

Do you have some examples?

How about a comma in the name?  If there's a comma in the name, then it must be quoted.   Otherwise no program would know the proper place to separate the columns.

Accent marks, special characters, or similar stuff?

I just ran a simplified form of your command on a directory with over 1,000 files and nothing came back quoted, so more info is needed.
"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

U_turn

Thanks for a tip, StarGeek, and sorry for failing to notice commas in some of my filenames :)
Yes, it was about having commas...

In any case, as I'm trying to parse output with another command, is there a way to get all filenames quoted or not quoted?
As far as I understand, -sep option doesn't work with -csv

Thanks

StarGeek

Quote from: U_turn on August 07, 2018, 04:12:03 PM
In any case, as I'm trying to parse output with another command, is there a way to get all filenames quoted or not quoted?

Not with the -csv option alone, you would have to roll your own csv with the -p option.  See FAQ #12.  Near the end of that entry, it gives you a example of a FMT file that would duplicate a CSV output.  Just replace it with the tags you want to pull and put quotes around them, like this:
#[HEAD]FileName, Aperture, ISO
"$filename", "$aperture", "$iso"


Example output:
C:\>exiftool -p temp.txt y:\!temp\Test3.jpg
FileName, Aperture, ISO
"Test3.jpg", "0.33", "640"
"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

U_turn

Thanks, StarGeek, but what should I put as a format string to get SourceFile? $SourceFile is not recognized by -p...

Quote from: StarGeek on August 07, 2018, 06:09:07 PM
Not with the -csv option alone, you would have to roll your own csv with the -p option.  See FAQ #12.

U_turn

No worries, I found solution by myself. -p $directory/$filename does the trick instead of SourceFile.

Quote from: U_turn on August 08, 2018, 01:55:36 AM
Thanks, StarGeek, but what should I put as a format string to get SourceFile? $SourceFile is not recognized by -p...

Quote from: StarGeek on August 07, 2018, 06:09:07 PM
Not with the -csv option alone, you would have to roll your own csv with the -p option.  See FAQ #12.

StarGeek

"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