How can I extract values from a file using shell-script (grep, awk or sed for example). I have the following structure (described below) and I want to get an output file with only the second column of the file.
I tried using grep:
grep -oP '\s*U238\s*\*\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?' file >U238_out to extract all U238 values from the entire file and store it in an output file (U238_out).With this I get the following output:
U238 * 1.779265E+03
U238 * 5.418484E-03
U238 * 1.777156E+03
...
but I want to obtain this structure:
1.779265E+03
5.418484E-03
1.777156E+03
File Structure:
PERIODICITY : 0
SYMMETRY : 0
MATERIAL MFUEL
MEDIUM MFUEL VOLUME 8.308106E+05
*******************************************************
* ISOTOPE * MASS (KG) * CIP * EQFMASS *
*******************************************************
* U238 * 1.779265E+03 * 28.125 * 0.000000E+00 *
Thanks in advance.