conditional writing of sql code

Hello again... I have a request from another department to list for them all the columns and tables we use in this certain database. I have spooled the oracle stored procedured into 1 file. I need a way to write out parts of that file. The criteria is to to start the block to be written when the word "SELECT" is found, end the block when either a semicolon or the word "WHERE" is found. I suspect there are mixed case versions of these words but this should get over 95% of the cases.

thanks in advance for any help.
Kathy

never mind stopping at the WHERE clause, we have to take that clause too. SO realy we can stop the block at the next semicolon...