I have a file as below and want to change it using awk
I want to find the entries such as
Iteration No.788
Best Value 0.00408152
Next-Worst Value 0.00522935
Worst Value 0.00523487
and change it to
Iteration No.788
788. Best Value = 0.00408152
788. Next-Worst Value = 0.00522935
788. Worst Value = 0.00523487
***********************************************
TSIMPLEX V1001
Non-linear Local Inversion using Simplex Algorithm
**********************************************
Parameter Reading
Base model = m04.base
Reading data file (.dat): P PHASES/SOURCES/DATA Done
DTau = 0.03
MDAcc = 0.1
Mindist = 0.05
Maxitertp = 25
Sigma0 = 1
Travel Time Data file = m04-npt06-sr40-syn.dat
Number of layers = 1
Parametrization of Layer n. 1
P:
NxP = 16
NzP = 12
NxS = 2
NzS = 2
Ni = 2
IntI = LIN
IntP = LIN
IntS = LIN
VarI = -1
VarP = 0.03
VarS = -1
PDegP = 1
PDegS = 1
PDegI = 1
Inmod = m04-npt06-sr40-syn-dp01-16x12drw.vmod
Out file = m04-npt06-sr40-syn-dv0p03-16x12smp.vmod
Expl file = m04-npt06-sr40-syn-dv0p03-16x12smp.expl
Backup file = m04-npt06-sr40-syn-dv0p03-16x12smp.bck
MaxIter = 2000
Tol = 0
Starting SIMPLEX for minimization
Building Initial 193 Vertex Simplex
Initial Simplex
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Iteration No.785
Best Value 0.00408152
Next-Worst Value 0.00523954
Worst Value 0.00524134
Reflection
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Replace W with R
RTol = 0.248474
Iteration No.786
Best Value 0.00408152
Next-Worst Value 0.00523606
Worst Value 0.00523954
Reflection
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Negative contraction
Replace W with Cn
RTol = 0.24782
Iteration No.787
Best Value 0.00408152
Next-Worst Value 0.00523487
Worst Value 0.00523606
Reflection
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Negative contraction
Replace W with Cn
RTol = 0.247595
Iteration No.788
Best Value 0.00408152
Next-Worst Value 0.00522935
Worst Value 0.00523487
Reflection
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Shot n.1 Shot n.2 Shot n.3 Shot n.4 Shot n.5 Shot n.6 Shot n.7 Shot n.8 Shot n.9
Replace W with R
RTol = 0.246558