You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using readr::write_csv to dump a comma-delimited file out for my Excel-using friend. A couple of cells have commas in the cell value, so those are escaped with double quotes. So far so good.
My friend opens the file and hits Ctrl-S, without making any edits.
Oddly, what Excel writes out is now delimited by tabs, not commas.
Digging a little deeper, I try the same thing myself, but "Save As" instead of Ctrl-S ... and see that Excel is suggesting "UTF-16 Unicode Text (.txt)" in the "Save As" dialog. WTF?
csvclean (from csvkit) reports no errors in the file on disk.
I'm on a Mac, so the line endings are not CRLF. But I can convert them to CRLF (using unix2dos) and the same thing happens.
The problem is avoided by using base::write.csv with quote = TRUE.
Can we have a quote = option in write_csv? Maybe the default should be FALSE. But why not allow it?
I like the efficiency of selective quoting but we have to share the world with Excellers.
Thanks!
The text was updated successfully, but these errors were encountered:
I'm using
readr::write_csv
to dump a comma-delimited file out for my Excel-using friend. A couple of cells have commas in the cell value, so those are escaped with double quotes. So far so good.My friend opens the file and hits Ctrl-S, without making any edits.
Oddly, what Excel writes out is now delimited by tabs, not commas.
Digging a little deeper, I try the same thing myself, but "Save As" instead of Ctrl-S ... and see that Excel is suggesting "UTF-16 Unicode Text (.txt)" in the "Save As" dialog. WTF?
csvclean
(fromcsvkit
) reports no errors in the file on disk.unix2dos
) and the same thing happens.base::write.csv
withquote = TRUE
.Can we have a
quote =
option inwrite_csv
? Maybe the default should beFALSE
. But why not allow it?I like the efficiency of selective quoting but we have to share the world with Excellers.
Thanks!
The text was updated successfully, but these errors were encountered: