[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: load from ascii files
From: |
Ben Abbott |
Subject: |
Re: load from ascii files |
Date: |
Fri, 05 Nov 2010 10:33:36 +0800 |
On Nov 5, 2010, at 3:12 AM, Elliott Waldron wrote:
> I have been using the load function with try/catch to test whether a file has
> 'load'able numeric data.
> However, the load function will not throw an error if the line starts with
> an 'n'.
>
> e.g.,
>
> octave:90> system('echo elliott > tmp.txt')
> ans = 0
> octave:91> load('tmp.txt')
> error: load: failed to read matrix from file `tmp.txt'
> octave:91>
> octave:91> system('echo niko > tmp.txt')
> ans = 0
> octave:92> load('tmp.txt')
> octave:93> tmp
> tmp = 0
> octave:94>
>
> Is this by design?
>
> Thanks,
>
> Elliott
My initial thought was you should include "-ascii" as an option. However, when
I tried that with the developers sources I see the same behavior as you do.
Matlab gives the same result for each example.
>> tmp = load ('tmp.txt')
??? Error using ==> load
Unknown text on line number 1 of ASCII file
The behavior is not by design. I recommend you file a bug report.
https://savannah.gnu.org/bugs/?group=octave
Ben