Hi,
I have been trying to use a binary file created using fortran by the 'readu' command but I am unable to. My file is a 2 column 121 row array. I could read it if I use a FOR statement like this:
INPT = 'COORD_PTS.DAT'
OPENR, 14, INPT, /F77_UNFORMATTED
FOR J=0,120 DO BEGIN
READU, 14, X, Z
PRINT,X,Z
ENDFOR
CLOSE,14
But I want to read it as an array so as to use it for plotting later onwards. Help me how to read it as an array. When I try the following steps:
INPT = 'COORD_PTS.DAT'
OPENR, 1, INPT, /F77_UNFORMATTED
A=FLTARR(2,121)
X=A(0,*)
Z=A(1,*)
READU, 1, X, Z
PRINT,X,Z
CLOSE,1
I get the error: READU: Attempt to read past end of FORTRAN unformatted file record.
Kindly help me sort out the problem. I will be grateful to u.
|