egrep 'distance|amplification' $1 |\ awk -F"=" ' /distance/ { z = $2 ; ok=1 } /amplification/ { if(ok==1){ printf "%.5e %.5e\n", z, $2 }; ok=0 }'