Is there a switch or method to output CSV (or TSV) where the data could contain commas or spaces? Some sort of quoted form? I've tried to figure it out without achieving joy.
Thanks!
-J
The "standard", as much as there is one for CSV files, is to put double quotes around entries with a comma in them, as well as other items such as line feeds. Double quotes are doubled.
Example:
C:\>exiftool -G1 -a -s -Description y:\!temp\Test4.jpg
[XMP-dc] Description : Comma ,.<-Line Feed.Double Quote Space "
C:\>exiftool -G1 -a -s -Csv -Description y:\!temp\Test4.jpg
SourceFile,XMP-dc:Description
y:/!temp/Test4.jpg,"Comma ,
<-Line Feed
Double Quote Space "" "
Libre/Open Office will read CSV files correctly, but I recall that there is something that is legal in a CSV file that Excel has never interpreted properly.
Thank you, Mr StarGeek! However, I do not see how you are requesting the double quotes around the terms in your command...? Please forgive me if I am being insane again. :p
- J
There is only two items in that CSV. The source file column has the file path. Then a comma, which is the comma that separates the columns. Everything after that, including two line feeds, is one cell.
All of this is a single cell. The first and last quote are the quotes containing the cell. To include the double quote within the cell on the last line, it gets doubled.
"Comma ,
<-Line Feed
Double Quote Space "" "
This is the command I used to embed the data
exiftool -E -Description="Comma ,
<-Line Feed
Double Quote Space " " y:\!temp\Test4.jpg
With regards to Excel, new lines in the cell would cause problems. See this thread (https://exiftool.org/forum/index.php?topic=6863.0). I don't know if that is still the case since I don't use Excel. Libre Office has no problems when there are new lines in a cell.