How can find a specific number in a text block and print the complete text block beginning with the key word \"BEGIN\" and ending with \"
\"BEGIN\"
\"
This might work for you (GNU sed):
sed -n '/^BEGIN/{x;d};H;/^END/{x;s/^B: 567/&/mp}' file
or this:
sed -n '/^BEGIN/!b;:a;$!{N;/\nEND/!ba};/\nB: 567/p' file