How do we join two lines in oracle and grep for a word from line
I have a text file with some lines like the following.I want to make it single line,say,make the select statement in one line and to cutonly table name from that line.
select name
from
emp
where id='20'
select id from
dept
where
dept like 'Or%'
-----------------
I want the output like
select name from emp where id='20'
select id from dept where dept like 'Or%'
How do i check for new line character and Concatenate it?Also i want grep the 1st word after 'from'.
Thanks.