Re: Reading data from file [message #9613] |
Wed, 23 July 1997 00:00 |
wonko
Messages: 22 Registered: March 1997
|
Junior Member |
|
|
ncw@dl.ac.uk (Neil Winrow) wrote:
> I need to read data from a file I open as part of my progam. The
> problem is the data I need to read is on a specific line and column of
> the data file and I can't seem to read the correct column. I have seen
> the 'TL' function for reading formatted data, but can't seem to use
> it. The idea is to search down so many lines and then across so many
> columns, and read the next three columns of integer values. If anyone
> understands my problem can they help.
I doubt I understand you right... anyway, what about this:
openr, unit, filename, /get_lun
line = intarr( number_of_columns )
repeat begin
readf, unit, line
endrep until ( found_the_right_line or eof( unit ) )
free_lun, unit
This works only if every line consists of the same number of integer
values. Maybe this is not the case? Do you know in which row your data
is? Then you could just skip some lines:
dummy = ''
for i = 1, number_of_lines do readf, unit, dummy
Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
|
|
|