Grep between block of lines in a file

Hi Friends,

I have a file which has many of the statements like below

******** MAKING > noun1 [src/noun1] < cg_all
statements
statements
statements
********* MAKING > noun2 [src/noun2] < cg_all
statements
statements
statements
********* MAKING > noun3 [src/noun3] < all
statements
statements
statements

I would need to grep few words in each and every of statements.. Ex: grep "ERROR:" between the noun1 and noun2 and then between noun2 and noun 3 and so on.. Is there a way in uniz to achive it.. Your help is highly appreciated..

Hello,

could you post the sentence you are using?

cat file.txt | sed '/noun1/,/noun2/!d' | grep ERROR

using grep that is work around process.
see using sed we can acheive the your requirement.

sed -n '/noun2/,/noun3/!d;/ERROR/p' log

if you want use grep see the man page.