Can someone give me a short awk example of how to:
use a loop to print records once an if condition is met,
read the next specified number of lines and print records.
such as: if ($1 = "a" { print 4 records including the a record }
a
sdfsdf
sdfsdf
sdfsdf
b
sdfsd
sdfsdf
sdfs
output would be
a
sdfsdf
sdfsdf
sdfsdf
use a loop to print records once an if condition is met,
read the next specified number of lines and print records.
such as: if ($1 = "a" { print 4 records including the a record }
a
sdfsdf
sdfsdf
sdfsdf
b
sdfsd
sdfsdf
sdfs
output would be
a
sdfsdf
sdfsdf
sdfsdf