I would like to extract only text that only begins with ${PL}/Q${CON}.KSH " and ends in " to extract only the sql statements.
Do you know how could I make these.
I prefer with awk.
Thanks and sorry for my English!
The more versions of texts you have the more awk adaptions/versions you need, unless you find a general way to decribe all possible structures. For your second sample, try
awk '/^"$/ {P=0} P;/\${ARQ}\/Q_\${UPPP}.SH \"/ {P=1}' FS=\" file
SELECT * FROM MAX_TMP
WHERE ...
.....
.....
This will fail for the slightest deviation from the file structure given, e.g. a trailing spaces in the last line.
Try to find the generic description, and it will be possible to find a general solution...