; parse_adc_lin, 'LOG10-09-09B.sav' ;pro parse_adc_lin, filename ;path = '/Users/bwgref/nustar/asic_screening/' ;filename = path+filename f = file_info(filename) if ~f.exists then message, 'File not found.' ; Open file for reading openr, lun, filename, /get_lun type = 'temp' ; Get the file header: readf, lun, type first=-1l last=-1l i=0l nlines = 0.d nentries=17 data2=fltarr(nentries) datax= 0 while not eof(lun) and last EQ -1l do begin temp = 'string' readf, lun, temp if (strpos(temp,'DONE') ne -1) then last=0 else begin ; sometime two column marge. throw out them and fill with dummy data ; which will also throw out. temp2=strmid(temp,9)+' 5000 5000 5000 5000' reads,temp2,data2 if n_elements(datax) le 1 $ then datax = data2 $ else datax = [datax, data2] nlines++ ;print,nlines endelse endwhile close,lun free_lun, lun data = reform(datax, nentries, nlines) end