help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: csv2cell


From: Philip Nienhuis
Subject: Re: csv2cell
Date: Sat, 11 Oct 2014 14:24:40 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:25.0) Gecko/20100101 Firefox/25.0 Iceape/2.22

Hi Houtan,

1. Please do not email developers & contributors privately; use themailing lists.

Read on....

Houtan Bastani wrote:
Hello,

We make use of your csv2cell function in our program, dynare.

I hope I’m not bothering you, but I was curious as to why you limit the number 
of characters per line in the .csv file to be 4096. A priori, this seems like 
an unnecessary constraint. But, of course, you wouldn’t have made that 
constraint if it weren’t necessary, so I was just wondering why it’s there.

I didn't limit that line length; the io package (of which I'm the maintainer) "inherited" the csv2cell & cell2csv functions from another octave-forge package and since then I have debugged them and added some more functionality. So no, I have no reason for the line length limit other than that I never saw any reason to touch it.

That said, I can imagine that text files with lines longer than 4096 characters have limited use for humans (reading). But possibly they are useful for communication between programs w/o human interference.

FYI, the textread / textscan functions also have a line length limit of 4096 chars (imposed by some EOL testing routine).

If you require longer line lengths for csv2cell, it is very easy to fix that yourself: In the source code of csv2cell, there's a constant MAXSTRINGLENGTH, initialized to 4096. Just change that number to anything you think is reasonable, also fix the error message a little lower (that currently claims max line length is 4092 - oopsie a buglet) and rebuild (in Octave):

mkoctfile csv2cell.cc

and put the csv2cell.oct file into the io package's bindir (do
which csv2cell   ## again in Octave
to find out where it is).

It may be that you hit system limits for too long line lengths; if so, please inform me of that.

Good luck,

Philip




reply via email to

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