Re: Help needed: read procedure for SCAN-data (soil climate analysis network) [message #45664] |
Mon, 26 September 2005 06:52  |
peter.albert@gmx.de
Messages: 108 Registered: July 2005
|
Senior Member |
|
|
Hi Daniel,
from a quick glance at the website, I'd guess that the files come as
plain ASCII files. In that case, you might start with something like
openr, lun, filename
line = ""
while not eof(lun) do begin
readf, lun, line
print, line
elements = strsplit(line, /extract)
help, elements
endwhile
free_lun, lun
With the "openr" command you open the file for reading. Each subsequent
call to "readf" reads one line into the (string) variable "line"
defined in the second line. Most likely you can seperate the
individual pieces of information contained in this line with the
"strsplit" command, if not, you will have to have a close look into the
manual and learn something about the "format" keyword to "readf". Each
individual element can then be adressed e.g. like
data = elements[2]
which will give you the third element in that line. (IDL starts
counting at zero.)
If you don't have ASCII files but HDF, netcdf or similar, things are
different, but easier. Just tell us.
Regards,
Peter
|
|
|
|