help-octave
[Top][All Lists]
Advanced

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

Re: Loading (large) text file, "error: load: unable to dermine file form


From: Przemek Klosowski
Subject: Re: Loading (large) text file, "error: load: unable to dermine file format of 'trainsetdata.txt'
Date: Wed, 6 Dec 2017 12:45:29 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 12/06/2017 12:02 PM, Doug Stewart wrote:
On Wed, Dec 6, 2017 at 8:30 AM, Jean-Etienne Verrot <address@hidden> wrote:

I'm trying to load the enclosed dataset in octave, and get the following error:
error: load: unable to dermine file format of 'trainsetdata.txt'

line 207 has NA   #value!
...
192 236 1 NA #VALUE! 0.5625
This of course doesn't work, but Octave can read some non-numerical values like
NaN (not-a-number) and  Inf. so you can replace NA with NAN and #VALUE! with either NaN or Inf, whichever seems more appropriate:

perl -i.bak -pe 's/NA/NaN/g; s/#VALUE!/Inf/g' trainsetdata.txt

It's also possible to use textread() which is not fazed by non-numeric values, but it requires more decisions and processing of the result.

reply via email to

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