Awk - print next record following matched record

前端 未结 2 798
旧时难觅i
旧时难觅i 2021-02-10 22:59

I\'m trying to get a next field after matching field using awk.

Is there an option to do that or do I need to scan the record into array then check each field in array a

2条回答
  •  感动是毒
    2021-02-10 23:17

    No need for slowing things down using a loop :)

    awk -F1 '/FIELDB2/ {f=NR} f&&NR-1==f' RS="1" file
    VALUEB2
    

提交回复
热议问题