npts = 20 x = float(randomu(1234,npts)) y = x[sort(x)] z = x^2 ;+++++++++++++++++++++++++++++++++++++++++ ; fortran binary files + ;+++++++++++++++++++++++++++++++++++++++++ ; You'll need to write the files first. Download and run the fortran ; programme ..... ; read the ascii file openr,unit,'myascii.dat',/get_lun n = 0l & j=1l readf,unit,n x = fltarr(n) data = 1.0 for i=0,n_elements(x)-1 do begin $ & readf,unit,j,data $ & x[i]=data $ & endfor close,unit free_lun,unit ; ditto for binary file openr,unit,'mybin.dat',/get_lun,/f77_unformatted,/swap_endian n = 0l readu,unit,n a= fltarr(n) readu,unit,a free_lun,unit ; check for i=0,n-1 do print,' i = ',i,' ascii value = ',x[i],' binary value = ',a[i] ; things to note: ; readf,unit,j,x[i] does not seem to work. Hence I read the value as ; "data" first, then copy it into x ; Note the /swap_endian keyword to openr. It is easy to change the ; endian-ness like this, but it does show the extreme limitation of ; unformatted (binary) files. If you run idl and f90 on the same ; computer, you should not need the /swap_endian, but I wrote them on ; my pc (because the suns do not have f95), then read them on the sun. ;