I have a results file that contains:
==============================================
------------------------------
Begin SimulationInterface Evaluation 1
------------------------------
Parameters for evaluation 1:
-1.8961789208e+00 x1
-1.3853582017e+00 x2
Direct interface: invoking function
Active response data for SimulationInterface evaluation 1:
Active set vector = { 1 }
2.4892772154e+03 response_fn_1
------------------------------
Begin SimulationInterface Evaluation 2
------------------------------
Parameters for evaluation 2:
3.7988695564e-01 x1
1.5859091288e+00 x2
Direct interface: invoking function
Active response data for SimulationInterface evaluation 2:
Active set vector = { 1 }
2.0820416317e+02 response_fn_1
==================================
Now I want to extract only the integers x1
, x2
, and response_fn_1
from the results file to a separate file, say test
. To extract lines with x1
and x2
, I have:
sed -n '/Parameters for evaluation/{n;p;n;p}' initial.log
How do I transfer the integers from this line to an output test
file so that x1
and x2
are in tabular form as:
x1 x2
-1.8961789208e+00 -1.3853582017e+00
3.7988695564e-01 1.5859091288e+00
response_fn_1
look like? – Freddy Aug 26 '19 at 0:08