- 论坛徽章:
- 1
|
[monitor@test ~]$ more 1.txt
insert into info values('23399','136.2.2.2','132.1.4.122','NIC_20100329.0001','4096','20100510161212','20
100510161214');
insert into info values('23400','136.2.2.2','132.1.4.122','NIC_20100328.0001','4096','20100510161212','20
100510161214');
insert into info values('23401','136.2.2.2','132.1.4.122','NIC_20100328.0001','4096','20100510161212','20
100510161214');
[monitor@test ~]$
[monitor@test ~]$ sed "s/'\([0-9]\{14\}\)'/to_date('\1','yyyymmddhh24Miss')/g" 1.txt
insert into info values('23399','136.2.2.2','132.1.4.122','NIC_20100329.0001','4096',to_date('20100510161212','yyyymmddhh24Miss'),to_date('20100510161214','yyyymmddhh24Miss'));
insert into info values('23400','136.2.2.2','132.1.4.122','NIC_20100328.0001','4096',to_date('20100510161212','yyyymmddhh24Miss'),to_date('20100510161214','yyyymmddhh24Miss'));
insert into info values('23401','136.2.2.2','132.1.4.122','NIC_20100328.0001','4096',to_date('20100510161212','yyyymmddhh24Miss'),to_date('20100510161214','yyyymmddhh24Miss'));
[monitor@test ~]$
lz的的回复中有些自相矛盾的地方,首先,你说明这个时间字段所在位置不定,后来又说担心有这个时间张得一样的字段的数据了,这就要分析你这个张表info了,到底每个字段有描述的那种担忧的情况出现吗?担忧是可以的,但是需要有合理性 |
|