f = file_info(filename) if ~f.exists then message, 'File not found.' ; Open file for reading openr, lun, filename, /get_lun found = 0 while ~found do begin temp = 'temp' readf, lun, temp ; Check to see if any of these contain the string 'MEAN" test = stregex(temp, 'MEAN') check = where(test ge 0, found) temp = strsplit(temp, /extract) ; nfields = n_elements(temp); ; if strcmp(temp[nfields-2], 'MEANS! ') then found = 1 else $ ; print, temp[nfields-2] endwhile found = 0 data = 0 while ~found do begin temp = 'temp' readf, lun, temp temp = strsplit(temp, /extract) test = stregex(temp, 'MDA') check = where(test ge 0, found) if found gt 0 then break data = [data, float(temp[1])] endwhile data = data[1:*] close,lun free_lun, lun end