Skip to main content
2 of 6
added 81 characters in body; added 18 characters in body
Ryan
  • 3
  • 3

How to make awk print multil row match string in file text, with condition?

How can I print lines muitil patterns which meet a condition?

For instance for an input file

partially containing the following:


ID : 1

Status : Ok

Name : Lulu

Age : 18

State : US


ID : 2

Status : Ok

Name : Master Yi

Age : 22

State : UK


Codition :

IF [Name == Master Yi] | print

ID : 2

Status : Ok

Name : Master Yi

Age : 22

State : UK


please help

Thanks

Ryan
  • 3
  • 3