[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #50224] csv2cell() returns error when linefeed
From: |
Philip Nienhuis |
Subject: |
[Octave-bug-tracker] [bug #50224] csv2cell() returns error when linefeed(s) are present in text fields |
Date: |
Sat, 4 Feb 2017 11:17:30 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 |
Update of bug #50224 (project octave):
Severity: 3 - Normal => 2 - Minor
Status: None => Postponed
Release: 4.0.0 => other
Operating System: GNU/Linux => Any
Summary: csv2cell() returns error when linefeed(s) are
present in spreadsheet cells => csv2cell() returns error when linefeed(s) are
present in text fields
_______________________________________________________
Follow-up Comment #1:
I'm afraid this isn't gonna be solved soon :-(
csv2cell() invokes fgetl() to scan the file for nr. of lines, and fgetl()
doesn't care where it finds a newline, it just assumes it to be a "real" EOL
whether it's in a protected (by double quotes) cell or not.
In general it is very hard for lower level code to assess whether a newline
means EOL in the file context or is just part of some user text string. Tying
to solve that leads without exception to very messy and hard-to-maintain
code.
All I'll do for the moment is adding a note in the texinfo help text that the
(AFAIK) only non-printable character that cannot be in text cells is "\n".
I am sorry for this probably unsatisfactory solution :-)
A workaround is to turn the .csv into a spreadsheet file and read that using
xls/odsread and friends.
Admittedly you'd need to either wait until the next io release, or download
the io dev code from the repo yourself and turn it into a package that you can
install.
Setting status to "Postponed" and lowering priority.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50224>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/