Issue 834 - csv data format issues
Summary: csv data format issues
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: 605
Hardware: All All
: P3 Trivial with 10 votes (vote)
Target Milestone: ---
Assignee: frank
QA Contact: issues@sc
URL:
Keywords:
: 7370 13878 19556 21625 25814 32966 35612 36599 41888 44488 48271 (view as issue list)
Depends on:
Blocks:
 
Reported: 2001-05-01 05:53 UTC by issues@www
Modified: 2013-08-07 15:15 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description issues@www 2001-05-01 05:53:01 UTC
The import filter for csv files improperly interprets a newline within a text
field as the end of the current record. The behaviour should be to keep on 
reading that field until the text field is closed, escaping any newlines along
the way.

Excel will properly import the same csv file, properly escaping any newlines
that are encountered within a text field in a record. We really need to match 
this behaviour.

Even kspreadsheet from kde properly matches this behaviour. (sadly, gnumeric
does not; they recieved a similar bug report this evening)
Comment 1 peter.junge 2001-05-02 08:16:42 UTC
The 605 is a quite 'old' version. But I'll try to reproduce it in a 625.
Comment 2 peter.junge 2001-05-02 08:17:26 UTC
The 605 is a quite 'old' version. But I'll try to reproduce it in a 625.
Comment 3 peter.junge 2001-05-02 08:20:12 UTC
dummy text
Comment 4 peter.junge 2001-05-03 14:23:47 UTC
Reproduced in OOo627 on W2K. OOo doesn't recognise linefeed within a record. If
you create a file with linebreaks in a cell they are also not stored in CSV
format.
Comment 5 ooo 2001-05-04 10:54:37 UTC
yep
Comment 6 stx123 2001-08-09 21:36:14 UTC
reassigned to correct account
Comment 7 ooo 2001-08-21 11:49:06 UTC
reaccepted..
Comment 8 Unknown 2001-11-08 23:05:51 UTC
changing QA contact from bugs@ to issues@
Comment 9 ooo 2002-12-09 13:52:32 UTC
Setting target to OOo 2.0
Comment 10 pavel 2003-02-02 17:35:27 UTC
Eike,

this problem hits many people. Is it possible to change target to
1.0.x or 1.1?
Comment 11 ooo 2003-02-03 12:27:08 UTC
@Pavel:
Only if I'd have some spare time, which I doubt and the reason I set
this issue to OOo2.0. Fixing this would mean to change the parser and
the preview to not read in lines of data anymore, which isn't that
complicated but also not a trivial fix. In fact the preview would give
more headache I guess.
Comment 12 daniel.rentz 2003-02-03 13:22:32 UTC
Preview should replace \n in a string with something reasonable, as
currently done with TAB characters. I think trying to show strings in
multiple lines would break nearly everything in the preview.
Comment 13 ooo 2003-03-03 18:13:34 UTC
*** Issue 7370 has been marked as a duplicate of this issue. ***
Comment 14 frank 2003-09-15 09:24:14 UTC
*** Issue 19556 has been marked as a duplicate of this issue. ***
Comment 15 frank 2003-10-24 08:52:59 UTC
*** Issue 21625 has been marked as a duplicate of this issue. ***
Comment 16 Frank Schönheit 2003-11-25 16:50:28 UTC
Hmmm .... would this also be interesting for database access?
Comment 17 ooo 2003-11-26 10:45:53 UTC
Hi Frank,

Makes also sense for the dba CSV import. I'll try to generalize the
approach if it can be untangled from the Calc import and make it
available as a kind of SvStream::ReadField() method, if possible.
Comment 18 Frank Schönheit 2003-11-26 14:34:06 UTC
great!
Comment 19 foobar 2003-12-12 09:59:07 UTC
Hi

A while ago I reported http://www.openoffice.org/issues/show_bug.cgi?id=21625 (a
duplicate, sorry).

I just wanted to show how I dealt with the problem, here's some sample code:
http://www.pinkjuice.com/howto/vimxml/tasks.xml#markinguptables
(=> "Complex CSV")

Not sure if it's of any help, since you probably don't use regexen to parse the
CSV data, and since my code is probably not general enough.

Anyways, good luck with fixing this bug,

Tobi

Comment 20 deangrim 2004-02-25 02:04:34 UTC
*** Issue 25814 has been marked as a duplicate of this issue. ***
Comment 21 lbc 2004-02-25 02:07:39 UTC
Is there anything I can do to help get this issue fixed quickly?  It's been
around for a long time, and it's causing a lot of extra work here.  We know that
the spreadsheet can handle multi-line data in a single cell (hit Ctrl-Enter), so
it can't be a fundamental problem with the spreadsheet; it is a problem with the
import filter, the routines that support imports, the import API, or something
completely different?
Comment 22 ooo 2004-02-25 13:14:44 UTC
Lbc,

This is nothing for a quick-fix, the line oriented parser has to be changed, and
as mentioned above, ideally a stream reading field extractor should be created,
which isn't much more work than doing nearly the same for Calc only. I have it
on my ToDo list for OOo2.0 together with some other CSV related issues. If you
want to help with it you could create a SvStream::ReadField() method that reads
fields into an OUStringBuffer, taking the field separators into account and
whether consecutive separators should be combined into one. If you're interested
please submit a JCA form (see http://www.openoffice.org/contributing.html)
before submitting code.

Thanks
Eike
Comment 23 lbc 2004-03-31 03:13:39 UTC
er, can we up the priority on this one?  It's been around a while and it's
causing a lot of grief.
Comment 24 Frank Schönheit 2004-03-31 06:59:21 UTC
It's targeted for 2.0. Even if you raise the priority, it will still only be
fixed for 2.0 ...
Comment 25 frank 2004-08-13 14:47:02 UTC
*** Issue 32966 has been marked as a duplicate of this issue. ***
Comment 26 mmeeks 2004-08-13 17:50:06 UTC
So the actual data import part of this is fixed here:
   http://bugzilla.ximian.com/show_bug.cgi?id=62446

The preview needs some re-architecting loving - but the code is ugly in there.
It can of course, stay line-based, but the line-data needs re-freshing if the
text delimiter changes.
Comment 27 ooo 2004-08-16 13:05:23 UTC
Michael, thanks for the pointer.

Just a status update: this issue is assigned to CWS csvio, see 
http://eis.services.openoffice.org/EIS2/servlet/cws.ShowCWS?Id=1037&Path=SRC680%2Fcsvio

Eike
Comment 28 mmeeks 2004-08-20 15:20:36 UTC
So - I completed our GUI re-factor to make this pleasant, and powerful.
Our patches are at:

http://ooo.ximian.com/ooo-build/patches/OOO_1_1/sc-csv-newline.diff
http://ooo.ximian.com/ooo-build/patches/OOO_1_1/sc-csv-gui.diff

HTH.
Comment 29 ooo 2004-09-13 17:42:57 UTC
On branch cws_src680_csvio:
tools/inc/stream.hxx 1.6.36.1
tools/source/stream/stream.cxx 1.16.34.1
sc/source/ui/dbgui/asciiopt.cxx 1.21.12.1
sc/source/ui/dbgui/scuiasciiopt.cxx 1.5.12.1
sc/source/ui/docshell/docsh.cxx 1.72.22.1
sc/source/ui/docshell/impex.cxx 1.29.12.1
sc/source/ui/inc/asciiopt.hxx 1.8.146.1
sc/source/ui/inc/scuiasciiopt.hxx 1.3.132.1

Note that there are quite some differences to the patches mentioned above.

@Frank: new method SvStream::ReadCsvLine()
Comment 30 ooo 2004-09-16 20:10:47 UTC
Reopen to reassign.
Comment 31 ooo 2004-09-16 20:11:09 UTC
Reassign to QA.
Comment 32 ooo 2004-09-16 20:11:31 UTC
Restore status.
Comment 33 frank 2004-09-21 14:26:07 UTC
Found fixed on Solaris, Linux and Windows using CWS cvsIO
Comment 34 frank 2004-10-15 14:01:18 UTC
*** Issue 35612 has been marked as a duplicate of this issue. ***
Comment 35 frank 2004-11-03 16:01:21 UTC
*** Issue 36599 has been marked as a duplicate of this issue. ***
Comment 36 frank 2004-11-23 16:26:01 UTC
Found fixed on Master src680m62 using Linux, Solaris and Windows Build
Comment 37 frank 2005-02-02 16:15:11 UTC
*** Issue 41888 has been marked as a duplicate of this issue. ***
Comment 38 frank 2005-03-09 16:36:28 UTC
*** Issue 44488 has been marked as a duplicate of this issue. ***
Comment 39 frank 2005-04-27 14:19:39 UTC
*** Issue 48271 has been marked as a duplicate of this issue. ***
Comment 40 ooo 2006-05-15 11:48:50 UTC
*** Issue 13878 has been marked as a duplicate of this issue. ***