I was wondering if there is an easy way to use awk or any other command to parse a text file such that a file of something like:
Step Temp Enthalpy
0 0 -368
100 1 -369
200 2 -372
300 6 -362
400 9 -365
SHAKE stats (type/ave/delta) on step 500
1 1.09 8.71362e-08
500 13 -358
600 15 -339
.
.
900 25 -306
SHAKE stats (type/ave/delta) on step 1000
1 1.09 7.06858e-08
1000 28 -306
.
.
.
could print an output of only the specific column of numbers I want such as only the temperature values. I know I could just do something like awk '{print $2}'
for the temperature values but my particular data file has other lines of various data before and after the 'Step Temp Enthalpy' table that makes this impractical so I'd like to ideally cut out everything before and after this 'Step Temp Enthalpy' information and print out only the particular column of this section of the data file I need. The data file also has that 'SHAKE stats' line every 5 steps in addition to a line after it '1 1.09 ....etc' that I'd like removed.
If I were to print only the temperature column I'd like it to output:
0
1
2
6
9
13
15
.
.
25
28
Step Temp Enthalpy
followed by 5 lines of temps, then 2 lines to discard, then 5 lines of temps, then 2 lines to discard and so on? – steeldriver Jul 26 '18 at 3:04