[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Skipping comments in load files
From: |
Joe Koski |
Subject: |
Re: Skipping comments in load files |
Date: |
Tue, 05 Oct 2004 21:08:15 -0600 |
User-agent: |
Microsoft-Entourage/11.0.0.040405 |
on 10/4/04 9:15 PM, Dmitri A. Sergatskov at address@hidden wrote:
> Joe Koski wrote:
> ...
>
>> gnuplot will all ignore input data lines that start with #. I tried this in
>> octave with both # and % without success.
>>
>
> # seems to work for me:
>
> address@hidden octave]$ cat b
> # this is some comment line
> # plot y = 2*x
> # first column x second y
> 1 2
> 2 4
> 3 6
> # More comments here
> 4 8
> 5 10
>
> ...
>
> octave:1> load b
> octave:2> b
> b =
>
> 1 2
> 2 4
> 3 6
> 4 8
> 5 10
>
>
Dmitri,
Thanks for taking the time to respond. I tried some simple cases, and got
the same results that you did.
I figured out my problem. The particular file that I picked to try as an
example had a single space on the last "blank" line of the file. As a
result, I kept getting the error
octave:1> b = load("A1_714_raw.txt");
error: load: A1_714_raw.txt: inconsistent number of columns near line 6001
error: load: unable to extract matrix size from file `A1_714_raw.txt'
error: evaluating assignment expression near line 1, column 3
and of course, looking at the file in my editor didn't show that there was
an extra space in line 6001. When I deleted the space, the problem went
away. Apparently I had previously fixed that problem in the file where I had
stripped the header information.
The lesson learned: Watch that last blank line of the ascii input file.
I owe you a cup of coffee at the Frontier Restaurant across the street from
campus.
Joe
>> Thanks.
>>
>> Joe
>>
>
> Regards,
>
> 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
-------------------------------------------------------------