Hi,
I have a file which contains DDL statements- CREATE TABLE, CREATE INDEX, ALTER TABLE etc.
I have to only pick CREATE TABLE statements from the file-
Source :
----------------------------------------------
--DDL for table abc
--------------------------------------------
CREATE TABLE abc(
col1 integer,
col2 varchar2(20),
col3 varchar2(50)
);
CREATE INDEX <statements>
<statements>
Output file should have only the lines for CREATE TABLE:
CREATE TABLE abc(
col1 integer,
col2 varchar2(20),
col3 varchar2(50)
);
So I have to process through the file and only pick the CREATE TABLE statements (multiple instances) and output to an output file.
Could you please help me writing a shell script for the same?