Hello panyam ,
Thanks for your help its working for me.
Is there any possiblity to extend this code like ...if we have input file like.
TAB1 COL1 DATATYP1 NULL
COL2 DATA TYP2 NOT NULL
COL3 DAT TYPE3 NOT NULL
..
..
COL N
out put should be
CREATE TABLE (COL1 DATATYPE1 NULL,COL2 DATATYPE2 NOT NULL,COL3 DATATYPE3 ....COL N DATA TYPEN NOT NULL);
because i have a raw Excel sheet which has columns like the above format using that Excel sheet i need to prepare a CREATE TABLE statemetns for all entries of Excel.so i am copying manually each table contenet in a txt file so that using this AWK command i can prepare a DDL for all tables at one shot.
[LEFT]TAB1 COL1 INTEGER NOT NULL
COL2 CHAR NOT NULL WITH DEFAULT
COL3... INTEGER NOT NULL WITH DEFAULT
COLn INTEGER NOT NULL WITH DEFAULT
Hi all Thanks for your help.Now i have 5 columns in my input file (this is last trail to my scripting i am about to achieve my out put please bear me).
For this input i need out put like .
[RIGHT]CREATE TABLE TAB1(COL1 INTEGER NOT NULL,
COL2 CHAR NOT NULL WITH DEFAULT,
COL3... INTEGER NOT NULL WITH DEFAULT,