grabing a number six lines below a pattern

前端 未结 4 1097
耶瑟儿~
耶瑟儿~ 2021-01-20 16:19

I have these lines repeating

                               FINAL RESULTS



    NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
    1         


        
4条回答
  •  爱一瞬间的悲伤
    2021-01-20 17:09

    OK, I think I see now.

    awk 'found==1 { print $2; found=0 } $2=="ENERGY" { found=1 }' inputfile
    

    This will get the number below ENERGY regardless of how many lines there are between it and FINAL RESULTS.

提交回复
热议问题