help-octave
[Top][All Lists]
Advanced

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

Re: load ASCII file


From: Paul Söderlind
Subject: Re: load ASCII file
Date: Wed, 10 Apr 2002 10:40:41 +0200

Hi again all,

thanks for the help. Here is a short summary of what I have learnt.

I wanted to load an ACII file with an array of numbers, using Octave 2.1.35
on cygwin (windows), but I often got an error message about "inconsistent
number of columns..."

This seems to happen when there are spaces (ASCII code 032) after the last
number on at least one line - and when the file is saved as a PC file
(carriage return/line feed at the end of each line, ASCII 013 and 010). It
does not happen when the same file is saved as a UNIX file instead (line
feed at the end of each line, ASCII 010).

I quick fix is to use the fscanf(fid,'%f') command instead: it seems to work
in all these cases.


Sincerely,

Paul Söderlind

***************************************************************
Paul Söderlind
Stockholm School of Economics
PO Box 6513
SE-113 83 Stockholm
Sweden

email: address@hidden
homepage: http://www.hhs.se/personal/psoderlind/

telephone: +46-8-7369161
***************************************************************




----- Original Message -----
From: "Paul Söderlind" <address@hidden>
To: <address@hidden>
Sent: Tuesday, April 09, 2002 9:17 AM
Subject: load ASCII file


> Hi all,
>
> can anyone share their knowledge of loading ascii files (with numerical
data
> in an array)?
>
> I've found that the load command is quite sensitive. For instance, it
fails
> if any line has a blank after the last numerical element. Is there FAQ
for
> the load command anywhere?
>
> Sincerely,
>
> Paul Söderlind
>
>
> ***************************************************************
> Paul Söderlind
> Stockholm School of Economics
> PO Box 6513
> SE-113 83 Stockholm
> Sweden
>
> email: address@hidden
> homepage: http://www.hhs.se/personal/psoderlind/
>
> telephone: +46-8--7369161
> ***************************************************************
>
>
>
> -------------------------------------------------------------
> 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
-------------------------------------------------------------



reply via email to

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