octave-bug-tracker
[Top][All Lists]
Advanced

[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 20:40:53 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46

Follow-up Comment #5, bug #50224 (project octave):

AFAIK csvread() in Matlab and Octave cannot read mixed-type csv files at all;
only numeric .csv files.  csv2cell() is a solution for that but with some
unfortunate limitations - although I see this multiline one as a corner case.
Again, rather than instruct LO to write .csv files, you can read LO
spreadsheet files directly with odsread/xlsread; even using LO itself using
the "UNO" interface (if you have Java installed).
Why go the difficult route through a .csv file?


Back to csv2cell():

(I think you know) csv2cell() has an option to prescribe the cell protection
character (default '"' - double quote) and separator (default = comma).

But no matter how you turn it, the one character that screws up in text
strings is "\n" because that is also interpreted by one of csv2cell's low
level routines. To change that would invoke a rewrite of half of csv2cell's
code. Quite unlikely at this point.


Maybe you could have a look at textscan(); that is much more flexible than
csv2cell. You might need to enter 
"delimiter", ",", "whitespace", ""
as input options but even then I'm afraid that EOL chars embedded in fields
will screw up.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50224>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]