Issue 94700 - CSV import chokes on an escaped " character
Summary: CSV import chokes on an escaped " character
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: open-import (show other issues)
Version: OOo 2.4.1
Hardware: PC Windows Vista
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2008-10-06 16:52 UTC by tmugford
Modified: 2022-12-27 13:38 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
An example document illustrating the problem described (281 bytes, text/csv)
2008-10-06 16:56 UTC, tmugford
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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
Comment 7 damjan 2022-12-27 13:38:28 UTC
We already support backslashes as escapes in SvStream::ReadCsvLine(), but the calling code never enables that nor would process the results further.