Issue 84048

Summary: CSV import brakes on in-text double-quotes.
Product: Calc Reporter: stlman <stlman>
Component: open-importAssignee: spreadsheet <spreadsheet>
Status: CLOSED DUPLICATE QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P2 CC: issues, kpalagin
Version: OOo 2.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
another example of the problem none

Description stlman 2007-11-28 12:30:56 UTC
Greetings All.

The issue has been discussed in the ticket 31441 but I really would like to
reopen the discussion. Let me describe my background a bit. I use a database
application which exports data as CSV. I cannot change neither the DB nor the
application in any way. There are several columns which contain user-entered
text (without any constraints). There are chances that I can make the author of
the application export better formed CSV. Which means backslash escaping

As far as I know CSV there is a "tradition" to escape special characters with a
"\". The tradition wich, unfortunately, OO does not obey. I suggest adding
support for backslash-escaping in CSV filters (both import and export).

PS. P2 because of data gets lost quite easyli.
Comment 1 kpalagin 2008-01-10 21:05:00 UTC
Please see http://sc.openoffice.org/servlets/ReadMsg?list=dev&msgNo=2091 and 
the whole thread.
Then consider discussing this in spreadsheet development list.
Comment 2 plouj 2008-02-05 05:35:51 UTC
Created attachment 51369 [details]
another example of the problem
Comment 3 plouj 2008-02-05 05:54:56 UTC
Sorry, the above attachment doesn't belong to this bug.
Admins: please remove it from this bug report if possible.
Comment 4 andrew 2009-09-30 00:47:55 UTC
According to the standard, 

"If double-quotes are used to enclose fields, then a double-quote
appearing inside a field must be escaped by preceding it with
another double quote."

See: http://tools.ietf.org/html/rfc4180

OOo does properly support the standard and import a double quote escaped by a
double quote. I recommend that the reporter use a script or macro to transform
the input to a valid CSV file before import.

Strictly speaking, A backslash is wrong. The requester, however, is asking that
OOo be modified to support a method that used to be common. I cannot comment on
whether or not this was ever standard, just common. I would be inclined to call
this an enhancement request, not a defect report. 

Test by pasting this into a Calc document:

"aaa","b""bb","ccc"
"aaa","b\"bb","ccc"
Comment 5 ooo 2009-10-02 15:28:05 UTC
There's already an issue for this.

*** This issue has been marked as a duplicate of 78926 ***
Comment 6 ooo 2009-10-02 15:28:31 UTC
Closing dup.