bash - Recursively finding with AWK -


i've got file looks this:

$cat myfile.dat  number of reps:     nrep=  19230 flop count:         nops=  4725964800.  clock resolution  4.7619047619047619e-4 , usecs time =  7.18247611075639725e-6 calc      0: time=    2.902 gflop/s=    1.629 error=         0.00000000 calc    201: time=    1.186 gflop/s=    3.985 error=         0.00000000 number of reps:     nrep=  13456 flop count:         nops=  4234564800.  clock resolution  3.7619047619047619e-4 , usecs time =  7.18247611075639725e-6 calc      0: time=    1.232 gflop/s=    2.456  error=         0.00000000 calc    201: time=    3.186 gflop/s=    1.345  error=         0.00000000 

i interested filter need :nrep,time , gflop/s last 2 of line starting calc 201.

so far i've managed filter want, except elements time , gflop/s. i've done:

awk -f'= ?' '/nrep=/||/time=/||/gflop/{print $2}' myfile.dat  19230 2.902 gflop/s 1.186 gflop/s 13456 1.232 gflop/s 3.186 gflop/s 

this obviosly wrong. need, ideally in columns instead is:

19230 1.186 3.985 13456 3.186 1.345 

is there reasonbale way of doing that?

with gnu awk do:

$ awk 'nr>1{print $2,$27,$29}' rs='number of reps:' file 19230 1.186 3.985 13456 3.186 1.345 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -