I need an assistance in file generation using awk, sed or anything...
I have a big file that i need to filter desired parts only. The objective is to select (and print) the report # having the string "apple" on 2 consecutive lines in every report. Please note that the "apple" line has a HEX characters corresponding to it, that makes it really hard for me to filter this one out.
For simplicity, I used this sample file below. I appreciate all the help,as always....
thanks,
apalex
INPUT FILE:
-----------
REPORT #001
apple h'1
apple h'1
banana h'2
orange h'3
kiwi h'4
<
REPORT #002
apple h'1
banana h'2
orange h'3
kiwi h'4
<
REPORT #003
apple h'1
kiwi h'4
<
REPORT #004
apple h'1
apple h'1
banana h'2
orange h'3
<
REPORT #005
apple h'1
banana h'2
orange h'3
kiwi h'4
<
OUTPUT FILE (two "apple" in a report)
------------
REPORT OUTPUT #001
apple h'1
apple h'1
banana h'2
orange h'3
kiwi h'4
<
REPORT OUTPUT #004
apple h'1
apple h'1
banana h'2
orange h'3
<