Script required to extract a specific snippet from the entire file.

Hi,

I have a file with the following structure.

XXXXX...........
YYYYY...........
.................
..................
ZZZZZZ......
qwerty_start..............
..................
.................
..................
querty_end................
...........................
............................

I need to extract the following snippet and copy to a new file.

qwerty_start..............
..................
.................
..................
querty_end................

qwerty_start and qwerty_end is just an example. i have my own keywords which vary for different files. So both should be given as a variables. (i.e) it will be read as a input while executing the script.

Can somebody please help me on getting this?

Thanks in advance.

Duplicate...