next up previous contents
Next: Printing your graph. Up: Importing data Previous: Importing data   Contents

Writing data

Writing data is very similar to reading it:

pro write_data, data, output_file, binary=binary

;+
;pro write_data, data, output_file, binary=binary
;Writes data to output file in  ascii, unless keyword(binary) set
;John Marsham (18/04/2005)
;-

; Openw for write instead of openr for read
openw,1,output_file

if not keyword_Set(binary) then 
 ; printf to print ascii to file (print to screen)
 prinf,1,data
endif else begin
 ; writeu to write binary to file (readu to read it)
 writeu,1,data
endelse

;Close the file 
close,1

end



John Marsham 2005-04-22