I'm a new awk user, so there are a lot of things that I don't now how to do. I need to print a part of the line that follows certain pattern. For example I have this data as a part of the file Number of q in the star = 1
List of q in the star:
1 0.000000000 0.000000000 0.000000000
Dielectric constant in cartesian axis
( 12.793033167 0.000000000 0.000000000 )
( 0.000000000 12.793033167 0.000000000 )
( 0.000000000 0.000000000 12.793033167 )
I need to extract the number 12.793033167 only and my pattern is "List of q in the star".
I've found the solution how to extract the whole line after pattern:
awk 'c&&!--c;/pattern/{c=N}' file
However I do not understand how to update it in a way to print only 2nd column (Like with print $2).
Can anyone offer a good solution? Also it would be nice to have some detailed explanation how it works overall.