请问如何从这张表中得到四个数字?原来的输入要长得多,所以需要限制区域。
输入:
chil 2 44843.084886752418 44843.080972494339 0.38261625919046571
o 0 1 0 1 1 5.732820000 0.000 = PERIOD(0)
o 0 2 0 1 1 54002.864912732 0.000 = PERIASTRON EPOCH
o 0 3 0 1 1 0.086796671 0.000 = ECCENTRICITY
o 0 4 0 1 1 151.562809500 0.020 = PERIASTRON LONG.
o 0 5 0 1 1 107.927001263 0.053 = K1
o 0 6 0 1 1 0.418206121 0.000 = q = M2/M1, K2 = 258.071309
o 0 7 0 1 1 0.004220000 0.000 = d omega/dt
o 0 8 0 1 1 0.000000000 0.100 = d P/dt
o 0 9 0 1 1 0.000000000 0.100 = d e/dt
o 0 10 0 1 1 0.000000000 0.100 = d K1/dt
o 0 11 0 1 1 0.000000000 0.100 = d q/dt
o 2 1 0 1 1 99000.000000000 1650.000 = PERIOD(2)
o 2 2 0 1 1 39254.892879388 -984.000 = PERIASTRON EPOCH
o 2 3 0 1 1 0.770000000 0.010 = ECCENTRICITY
o 2 4 0 1 1 68.284996369 -6.000 = PERIASTRON LONG.
期望的输出
0.086796671
151.562809500
107.927001263
0.418206121
我尝试失败
/o 0 1 0 1 1 5.732820000 0.000 = PERIOD(0)/ { c=FNR;}
(FNR-c>=2 && c>0) {$2 ~ /\<0\>/ $3 ~ /\<3|4|5|6\>/ { print $7}
我想说:如果第二列是 0 而第三列是 3,4,5,6 打印列 7
更新
限制在特定区域: