Hi Everyone,
For some strange reason, I cant seem to get an answer on a topic that pales in comparison with some of the tough questions that have been posed here.
At any rate, after mucking with what was posted here by elixir_sinari here is what I got.
/Users/ManoharChandran 21:36:21 $cat ANOTHER | awk -F\( 'BEGIN{OFS=FS} {for(i=2;i<=NF;i++) sub(/\)/,", NEWCOLUMN)",$i);print}'
1389675 Opera_ShirtCatalog INSERT INTO Opera_ShirtCatalog(COL1, COL2, NEWCOLUMN) VALUES (1, 'TEST1', NEWCOLUMN), (2,'TEST2', NEWCOLUMN);
1389685 Opera_ShirtCatlog_Wom INSERT INTO Opera_ShirtCatlog_Wom(col1, col2, col3, NEWCOLUMN) VALUES (9,'Siz12, FormFit', 'Test', NEWCOLUMN);
Now, the LAST REMAINING ISSUE is I dont want the NEWCOLUMN in the values, I want the first value to be moved as "VALUE" to be inserted ... essentially what I need is below -
HTML Code:
/Users/ManoharChandran 21:36:31 $cat ANOTHER | awk -F\( 'BEGIN{OFS=FS} {for(i=1;i<=NF;i++) sub(/\)/,", NEWCOLUMN)",$i);print}'
Opera_ShirtCatalog INSERT INTO Opera_ShirtCatalog(COL1, COL2, NEWCOLUMN) VALUES (1, 'TEST1', 1389675), (2,'TEST2', 1389675);
Opera_ShirtCatlog_Wom INSERT INTO Opera_ShirtCatlog_Wom(col1, col2, col3, NEWCOLUMN) VALUES (9,'Siz12, FormFit', 'Test', 1389685);
NOT
/Users/ManoharChandran 21:36:31 $cat ANOTHER | awk -F\( 'BEGIN{OFS=FS} {for(i=1;i<=NF;i++) sub(/\)/,", NEWCOLUMN)",$i);print}'
1389675 Opera_ShirtCatalog INSERT INTO Opera_ShirtCatalog(COL1, COL2, NEWCOLUMN) VALUES (1, 'TEST1',
NEWCOLUMN), (2,'TEST2',
NEWCOLUMN);
1389685 Opera_ShirtCatlog_Wom INSERT INTO Opera_ShirtCatlog_Wom(col1, col2, col3,
NEWCOLUMN) VALUES (9,'Siz12, FormFit', 'Test',
NEWCOLUMN);
If someone can push this over this last
bump, I would be truly grateful.
Please advise !
regards,
Manohar.