I am monitoring the history of convergence of a certain problem. The history output is as follows:Time = 24Calculate volume forces from actuator diskTotal thrust = -8.46832Total torque = 1.03471ADisk volume = 0.0632799smoothSolver:  Solving for Ux, Initial residual = 0.000447755, Final residual = 2.68745e-05, No Iterations 2smoothSolver:  Solving for Uy, Initial residual = 0.0107909, Final residual = 0.000812227, No Iterations 2smoothSolver:  Solving for Uz, Initial residual = 0.0103399, Final residual = 0.000786661, No Iterations 2GAMG:  Solving for p, Initial residual = 0.123954, Final residual = 0.00958268, No Iterations 6time step continuity errors : sum local = 7.42808e-05, global = -4.25546e-05, cumulative = 0.000413527smoothSolver:  Solving for epsilon, Initial residual = 0.00197379, Final residual = 0.000172248, No Iterations 1smoothSolver:  Solving for k, Initial residual = 0.000510499, Final residual = 2.78594e-05, No Iterations 2ExecutionTime = 124.63 s  ClockTime = 125 sTime = 25Calculate volume forces from actuator diskTotal thrust = -8.49093Total torque = 1.03723ADisk volume = 0.0632799smoothSolver:  Solving for Ux, Initial residual = 0.000409002, Final residual = 2.59552e-05, No Iterations 2smoothSolver:  Solving for Uy, Initial residual = 0.0103191, Final residual = 0.00077024, No Iterations 2smoothSolver:  Solving for Uz, Initial residual = 0.00985658, Final residual = 0.000742227, No Iterations 2GAMG:  Solving for p, Initial residual = 0.0390756, Final residual = 0.00247253, No Iterations 7time step continuity errors : sum local = 5.39785e-05, global = 3.40394e-05, cumulative = 0.000447566smoothSolver:  Solving for epsilon, Initial residual = 0.00182397, Final residual = 0.000157739, No Iterations 1smoothSolver:  Solving for k, Initial residual = 0.000465916, Final residual = 2.75864e-05, No Iterations 2ExecutionTime = 129.45 s  ClockTime = 130 sTime = 26Calculate volume forces from actuator diskTotal thrust = -8.51463Total torque = 1.03953ADisk volume = 0.0632799What I would like to do, is to copy values at a certain time, say in this case at Time=26, the values of Total thrust = -8.51463Total torque = 1.03953in the following format:1.03953 -8.51463.Can someone help me to do that using shell script.
Parse logs for certain values
text processing;logs
You asked for a shell script, but hopefully awk will do:find_thrust_torque.awk:/^Total thrust =/ {thrust = $4}/^Total torque =/ {torque = $4}/^Time =/ {if (found) exit; if ($3 == time) found=1}END {print torque   thrust}Test It:$ awk -v time=25 -f find_thrust_torque.awk file11.03723 -8.49093$ awk -v time=26 -f find_thrust_torque.awk file11.03953 -8.51463