| Re: moving within a file [message #11058 is a reply to message #11052] |
Wed, 04 March 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Gerhard D. Rappold (rappold@zedat.fu-berlin.de) writes:
> I'm just a beginner of IDL and want do know how I could read an open
> file (or a part of it) severeal times. If you have openend the file
> (e.g. StrArr(6, 100) to read the file you do:
>
> data = StrArr(6,100)
> readf, data
>
> if you now want to read the 3 colume without starting over and doing the
>
> Free_lun,
> openF, lun, etc.
> again.
> How can you do it?
If you just want to "rewind" the file (or go some other place
in it), you can use the POINT_LUN procedure. For example, if
you want to rewind a file to its beginning, you can type this:
Point_Lun, lun, 0
If what you are asking is how do you read the 3rd column in
that 6 by 100 string array, then I would do it like this:
col3 = Reform(data[2,*])
You can find other tips about reading and writing data in
IDL on my web page.
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|