Thanks for the solution .. i am close but few more thingsg..
it is putting comma for every space in the result " see INSERT,INTO,schema.table,VALUES,(" and " 0,);commit ;"
Code
-------
V1S="INSERT INTO schema.table VALUES ("
V1E=");commit ; "
node=$1 ( here it is 10)
sed "s/\(.[^ \t]*\) \(.*\)/$V1S$node \2/;s/ /,/4g;s/$/$V1E/" File1 > File2
cat File2 | head -3
echo '' "
Result
--------
INSERT,INTO,schema.table,VALUES,(10,17,155,n/a,17,155,TAB1,SCH1,Perm,1,0,1,0,);commit ;
INSERT,INTO,schema.table,VALUES,(10,36,475,n/a,36,475,TAB2,SCH1,Perm,2,0,0,0,);commit ;
INSERT,INTO,schema.table,VALUES,(10,36,476,n/a,36,476,TAB3,SCH1,Perm,11396,0,0,0,);commit ;
One more thing , I also need ' " ' (double quotes) around 4th, 7th, 8th & 9th columns
We are close.. Something small is missing..
Shyam
Last edited by Vaddadi; 03-24-2010 at 02:34 PM..