Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing
|Summary:||CSV import chokes on an escaped " character|
|Component:||open-import||Assignee:||AOO issues mailing list <issues>|
|Status:||CONFIRMED ---||QA Contact:|
|Issue Type:||ENHANCEMENT||Latest Confirmation in:||---|
Description tmugford 2008-10-06 16:52:44 UTC
When opening a CSV file in Calc (fields enclosed by '"', terminated by ',' and escaped by '\'), any field containing a single escaped '"' character results in that line and all following lines being dropped.
Comment 1 tmugford 2008-10-06 16:56:24 UTC
Created attachment 57032 [details] An example document illustrating the problem described
Comment 2 Regina Henschel 2008-10-06 21:09:28 UTC
As far as I know, there exists no "escaping". You have to double the text delimiter, if it is part of your text. Your example would look "testing","testing","testing" "testing","testing","testing" "testing","test""ing","testing" "testing","testing","testing"
Comment 3 tmugford 2008-10-07 11:27:11 UTC
Researching this further, it seems that there is some disagreement amongst CSV supporting applications as to whether '\' can be used as an escape character. Certainly, the application generating the CSV files that first caused me to notice the problem considers the backslash as a legitimate escape character. Given that there was no official standard prior to RFC4180, and a number of alternative representations have already gained widespread adoption, should OO not provide some level of support for these alternative representations even if they're not strictly correct? Failing that, perhaps a more extensive entry in the help files describing the problem I encountered? Incidentally, I'm fairly certain that Office 2007 (and possibly earlier versions) handles the backslash escape character 'correctly'. It may be worth making the OO CSV import more forgiving purely for the sake of greater compatibility - or at least perceived compatibility - with MS Office.
Comment 4 Regina Henschel 2008-10-07 14:03:45 UTC
I change this to an enhancement request and hope you agree. Request: Make OpenOffice.org capable of using escape characters in import of csv (and I add it) and txt files.
Comment 5 tmugford 2008-10-07 14:20:52 UTC
Yes, I think you're right, it is an enhancement of sorts.
Comment 6 tmugford 2008-10-27 15:48:53 UTC
It transpires that the application I was exporting the troublesome CSV file from, is actually following a format required by MySQL's 'LOAD DATA INFILE'. http://dev.mysql.com/doc/refman/5.0/en/load-data.html