IDL/Input-Output

ডিপথট থেকে
< IDL

Reading data

Read a binary file:

openr, lun, 'filename', /get_lun
data = read_binary(lun,data_type=4,data_dims=100)
close,lun

Where Float=4, Double=5.

Writing data into file

To write unformatted data,

close,1
openw,1,'filename.dat'
writeu,1,data
close,1

To write default formatted data,

close,1
openw,1,'filename.dat'
printf,1,data
close,1

To write formatted data with user defined format,

openw, lun, 'filename.dat', /get_lun
printf, lun, data[0,*], data[1:9,*], format='(3(8(f6.2,x)),10I5))
free_lun, lun