Hello,
when I enter a command like this:
exiftool -csv -common photo1.jpg > test.csv
I get something like this as a output:
"/a/long/path/with/some/subfolders/photo1.jpg","photo1.jpg",125,auto,etc,etc
can I skip the first column sourceFile?
in my case the output looks neater without the sourceFile
Hello,
I don't think. It's seems to be used as identifier.
This column is also necessary if you want to add metadata through a csv file
No, it can't be suppressed when using the CSV option. But you can use the -p (printFormat) option (https://exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat) to create a csv file any way you want.
ok I'll take a look at the format option I didn't knew if that was possible
thanks for the tip
With the -p option writing CSV format, values must be quoted if they contain any special character such as comma, newline, quote, etc. You can do this by adding this to your command:
-api filter="$_ = qq{""$_""} if s/""/""""/g or /(^\s+|\s+$)/ or /[,\n\r]/"
I think this is the way the quotes should be escaped for Windows. For other OS's it would be simpler:
-api filter='$_ = qq{"$_"} if s/"/""/g or /(^\s+|\s+$)/ or /[,\n\r]/'
- Phil
Yes it works
thanks
I created test.fmt:
#[HEAD]Filename,Date,Aperture,Shutterspeed,ISO,Megapixels
$FileName,$DateTimeOriginal,f/$Aperture,${ShutterSpeed}s,$iso,${megapixels}
#[TAIL]
And I execute this command:
exiftool -f -p test.fmt 00.JPG 001.JPG 920.JPG > test.csv ; cat test.csv
3 image files read
Filename,Date,Aperture,Shutterspeed,ISO,Megapixels
00.JPG,2020:05:07 10:04:47,f/4.5,1/125s,800,8.3
001.JPG,2009:04:19 14:30:41,f/6.3,1/125s,-,6.0
920.JPG,2012:06:09 15:13:12,f/4.7,1/80s,125,14.0
Thanks guys for the help
btw @Phil Harvey
it works fine now without your sugestion of the -api filter
oh wait it didn't, the gps cordinates are comma separated and that messes the layout up.
your suggestion did the trick :-)
It works now
Great. I've added a note in FAQ 12 (https://exiftool.org/faq.html#Q12) to document this use of the -api filter option.
- Phil