0

In this file structure i want to extract the K-EFFECTIVE value and export it to an output file. How could I do it using shell script?. Thanks in advance.

                    ...
0          OUTER ITERATIONS COMPLETED AT ITERATION  25, ITERATIONS HAVE CONVERGED
0          K-EFFECTIVE =   1.08760108893
0          BREAKDOWN OF CPU TIME:    
               *********************     
           COUPLING COEFFICIENTS   =    15.80
           SOLUTION INITIALIZATION =     0.46
           OUTER ITERATIONS        =   263.21
           CREATE EDIT FILES       =     0.31
                     ...

1 Answer 1

0

Using GNU grep in PCRE mode:

grep -oP 'K-EFFECTIVE\s*=\s*\K.*' file > output
3
  • thanks for your replay, another question, I have several K-effective values, how do I export them all in the same output file in a column? Thanks for your help.
    – Yro
    May 29, 2019 at 1:49
  • @Yro the -o option should result in one line of output for each matched value i.e. a column of values in the output file May 29, 2019 at 1:52
  • Thanks!, it has been very helpful.
    – Yro
    May 29, 2019 at 1:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .