Please..how can I create command insert in shell script I have this code..but I do have problems with '.
I have this:
awk '{printf("INSERT INTO akcije (date, time, target1, target, action) VALUES ('%s','%s','%s','%s','%s');\n",substr($0,0,6),substr($0,8,17),substr($0,25,8),substr($0,33,6),substr($0,48,11));}' ca > CAndA.sq
result is: from CAndA.sq file:
..
...
INSERT INTO akcije (date, time, target1, target, action) VALUES (20060524,145222,5431,876,west);
...
.
which is not good command for mysql it needs to be like this:
INSERT INTO akcije (date, time, target1, target, action) VALUES ('20060524','145222','5431','876','west');
how can I show those ''...
Thanks..
I have this:
awk '{printf("INSERT INTO akcije (date, time, target1, target, action) VALUES ('%s','%s','%s','%s','%s');\n",substr($0,0,6),substr($0,8,17),substr($0,25,8),substr($0,33,6),substr($0,48,11));}' ca > CAndA.sq
result is: from CAndA.sq file:
..
...
INSERT INTO akcije (date, time, target1, target, action) VALUES (20060524,145222,5431,876,west);
...
.
which is not good command for mysql it needs to be like this:
INSERT INTO akcije (date, time, target1, target, action) VALUES ('20060524','145222','5431','876','west');
how can I show those ''...
Thanks..