I'm currently working with a text file that contains the following text blocks:

```
--------------------------------------
Beginning of block
Text
Random Text
keywordA
Text
End of block
--------------------------------------

--------------------------------------
Beginning of block
Text
Random Text
keywordA
Text
End of block
--------------------------------------

--------------------------------------
Beginning of block
Text
Random Text
keywordD
Text
End of block
--------------------------------------

--------------------------------------
Beginning of block
Text
Random Text
keywordd
Text
End of block
--------------------------------------

```

The objective is to have egrep detect certain keywords, and if those words exist, I would like to copy the block to another file. So, I'm currently searching with:

```
if egrep -wi 'keywordA|KeywordB|keywordC' Report
then
        echo "Words found!"

else
        echo "No words found!"
fi

```

I was wondering if there is any way to add a follow up action to use sed (for example) to copy the block of text where the words were found.

Expected output, in this example, would be:

```
--------------------------------------
Beginning of block
Text
Random Text
keywordA
Text
End of block
--------------------------------------

--------------------------------------
Beginning of block
Text
Random Text
keywordA
Text
End of block
--------------------------------------

```

The file "Report" contains dozens of blocks like this, but not all of them have the keyword. I would like to copy just the ones that do *(as demonstrated in the above example)*.