Menu

#195 odd behavior processing read columns

data I/O
open
5
2005-01-20
2005-01-20
No

I get inconsistent performance with reading a file of
x-y data with the following basic operation:

open data1.dat
while 1
read columns x y
if ..eof..
break
end if
draw axes none
draw curve
end while

The input data consists of many vector sets similar
to:

-3.21141 0
3.21141 0

-3.17967 0.314159
3.17967 0.314159

-3.08027 0.628319
3.08027 0.628319

-2.87718 0.968658
2.87718 0.968658

Many have more than 2 vector pairs. The problem
occurs at the end of file: if there is only a trailing
<new-line> the last two points wil not plot (no error
message). If an empty line is appended the last
vector pair will plot BUT the warning message will
appear:

Warning: `read columns' found EOF or blank line
before finding data.

Curent workaround is to append an extra <new-line>
and ignore message.

An additional problem is that:

set ignore error eof

does not seem to work. The orginal version of the
sortware creating the data files had to be modified
(at the expense of efficiency) to be sure not to output
a blank line at the beginning of output.

My personal recommendation is that vector set
separation be allowed to have one OR MORE blank
lines as separators and they can be located
anywhere in the source stream---regardless of VMS
or other OS. Of course, EOF also qualifies as a
segment terminator.

There are also inconsistancies of performance
depending upon how gri is executed but I don't have
the time to currently document them. They would
require transfering a lot of scripts and data.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB