version & csvread

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

version & csvread

abl5
Hi,

I am running into a problem with csvread & both tab-delimited and
comma-separated values files. The files are read in as having one row too
many. So far I've successfully eliminated whitespaces and strings, and
I've confirmed that the files are read correctly in Matlab. Searching &
Googling haven't resulted in much csvread/write info since about 2004, and
there doesn't seem to be a definite "error here" -- does my problem sound
familiar to anybody?

In more general terms, is it better to run 2.1.71 or 2.9.3? David called
2.1.71 a "dead end", but the Octave page recommends that non-developer
users should use that. I'm a newbie to Matlab, octave, & fink (and the
command line, actually), so... who knows? It might be relevant that I have
access to Matlab via a desktop at work, but I would really like to analyze
my data (via octave) on my Mac.

Thanks

Arwen



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: version & csvread

Stéfan van der Walt
Arwen,

Try to produce a minimalistic example of your problem.  For example,
can you produce the error in a datafile with only one line?  If so,
post the line of data and the command that fails here.

Regards
Stéfan

On Wed, Oct 26, 2005 at 01:44:46PM -0400, [hidden email] wrote:
> Hi,
>
> I am running into a problem with csvread & both tab-delimited and
> comma-separated values files. The files are read in as having one row too
> many. So far I've successfully eliminated whitespaces and strings, and
> I've confirmed that the files are read correctly in Matlab. Searching &
> Googling haven't resulted in much csvread/write info since about 2004, and
> there doesn't seem to be a definite "error here" -- does my problem sound
> familiar to anybody?



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: version & csvread

David Bateman-3
In reply to this post by abl5
[hidden email] a écrit :

>Hi,
>
>I am running into a problem with csvread & both tab-delimited and
>comma-separated values files. The files are read in as having one row too
>many. So far I've successfully eliminated whitespaces and strings, and
>I've confirmed that the files are read correctly in Matlab. Searching &
>Googling haven't resulted in much csvread/write info since about 2004, and
>there doesn't seem to be a definite "error here" -- does my problem sound
>familiar to anybody?
>
>In more general terms, is it better to run 2.1.71 or 2.9.3? David called
>2.1.71 a "dead end", but the Octave page recommends that non-developer
>users should use that. I'm a newbie to Matlab, octave, & fink (and the
>command line, actually), so... who knows? It might be relevant that I have
>access to Matlab via a desktop at work, but I would really like to analyze
>my data (via octave) on my Mac.
>  
>
Well 2.1.x is a dead-end is the real sense that only bug-fixes have been
applied to it since 2.1.64 and the development has been happening in
2.9.x. At the point where a 2.9.x release is blessed as "testing" by
John I don't expect that another 2.1.x release will happen. Whether such
a blessed release of 2.9.x will happen soon not or depends on whether
John is interested in stabilizing the existing 2.9 stuff or getting more
of the features on the 3.0 todo list into 2.9. For now stay with 2.1.71,
though in reality I find even the latest CVS of 2.9 to be quite stable...

Regards
David



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: version & csvread

Dmitri A. Sergatskov
In reply to this post by abl5
[hidden email] wrote:
> Hi,
>
> I am running into a problem with csvread & both tab-delimited and
> comma-separated values files. The files are read in as having one row too

In a pinch you can do C-style file i/o:

fid = fopen("filename");
a = fscanf("%f, %f, ... ",[n, end]);

etc...


Dmitri.
--



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: version & csvread

abl5
In reply to this post by Stéfan van der Walt
Stefan,

Yes, I can!
line of data:
1,1,,,2
> F = csvread('inc.txt')
F =

  1  1  0  2

The line in my data that gives me an error has a lot of sequential commas,
and if I use only that line as input data, I get a size of 74 columns
rather than the correct 84. So... I missed some whitespace.

I notice that Octave translates empty cells as "0"; does it have a way to
mark them as empty without assigning a numeric value?

Arwen

On Wed, 26 Oct 2005, Stefan van der Walt wrote:

> Arwen,
>
> Try to produce a minimalistic example of your problem.  For example,
> can you produce the error in a datafile with only one line?  If so,
> post the line of data and the command that fails here.
>
> Regards
> Stéfan
>
> On Wed, Oct 26, 2005 at 01:44:46PM -0400, [hidden email] wrote:
> > Hi,
> >
> > I am running into a problem with csvread & both tab-delimited and
> > comma-separated values files. The files are read in as having one row too
> > many. So far I've successfully eliminated whitespaces and strings, and
> > I've confirmed that the files are read correctly in Matlab. Searching &
> > Googling haven't resulted in much csvread/write info since about 2004, and
> > there doesn't seem to be a definite "error here" -- does my problem sound
> > familiar to anybody?
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
>
>



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------