Have a contents in file similar to below- There are many lines between START & END and might have errors/warnings too. I want to filter out errors/warning lines between START & END and skip if doesn't have. Heading is varying with different names. But make logic of printing next line of START(should be heading)
START
Heading1
.......
errors
........
END
START
Heading2
........
........
........
END
START
Heading3
.......
errors
Warning...
END
Expected output below
Heading1
errors
Heading3
errors
Warning...
I have tried below , but this prints everything between START & END . I have to filter out errors too
awk '/START/,/END/' file