fid = fopen('CAST0001.ENG')

castnum = 0
for n = 1:1400
line = fgetl(fid);

if (line == 'Free mode selected')
    fscanf(fid,'%*s %*d');
    fscanf(fid,'
    
    
end

end

fclose(fid)