Hi have Input in this way
KEY AAAA
BBBB
END1
KEY AAAA
BBBB
END2
KEY AAAA
BBBB
END3
I need to find any thing matching in between KEY And ending with "END1|END2|END3"
This didnot work
awk '/KEY/,/END1|END2|END3/'
how can we do this...
Hi have Input in this way
KEY AAAA
BBBB
END1
KEY AAAA
BBBB
END2
KEY AAAA
BBBB
END3
I need to find any thing matching in between KEY And ending with "END1|END2|END3"
This didnot work
awk '/KEY/,/END1|END2|END3/'
how can we do this...
awk -v RS="" -v ORS="\n\n" ' /^KEY/ && /END[1-3]/ ' file
anbu
actuvally
is not END[1-3]
It can be END or CLOSE of FILEEND
How do we try for those...
awk -v RS="" -v ORS="\n\n" ' /^KEY/ && ( /END/ || /CLOSE/ || /FILEEND/ ) ' file