| Re: moving within a file [message #11052] |
Wed, 04 March 1998 00:00  |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Gerhard D. Rappold wrote:
>
> Hello IDL users,
>
> 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?
>
> thanks
>
> Gerhard
since you are reading in a string array, you can convert this to numbers
by calling
READS,data(i),var1,var2,var3,...
(or you can download D. Foster's GET_TOKEN.PRO from
ftp://bial8.ucsd.edu/pub/software/idl/share/idl_share.tar.gz
)
If you really need to (re)position your file pointer,
res = fstat(ilun) ; get fileinfo structure
filepos = res.cur_ptr
point_lun,ilun,filepos ; set file pointer
(filepos must be LONG !)
Martin.
--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA
phone: (617)-496-8318
fax : (617)-495-4551
e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ -------
|
|
|
|