解答好快啊,今天又学了一招,但是我发现你的答案和lz的要求有点不一样,我修改了下
这是你的
- awk 'BEGIN{FS=OFS=","}{$6=substr($6,1,5)"-"substr($6,6,2)"-"substr($6,8,2)" "substr($6,10,2)":"substr($6,12,3);$9=substr($9,1,5)"-"substr($9,6,2)"-"substr($9,8,3)}1' test'3306020159210012280003','姚一煜','020611098901254036','320611','上海','2007-12-28 22:10','103','3206020159','1978-12-10','
- '330829D066200712280001','唐龙','920820660711061','320829','江苏','2007-12-28 23:25','215','320829D066','1980-10-19','
复制代码
我的
- awk 'BEGIN{FS=OFS=","}{$6=substr($6,1,5)"-"substr($6,6,2)"-"substr($6,8,2)" "substr($6,10,2)":"substr($6,12,2)":""00"substr($6,14,1);$9=substr($9,1,5)"-"substr($9,6,2)"-"substr($9,8,3)}1' test
- '3306020159210012280003','姚一煜','020611098901254036','320611','上海','2007-12-28 22:10:00','103','3206020159','1978-12-10','
- '330829D066200712280001','唐龙','920820660711061','320829','江苏','2007-12-28 23:25:00','215','320829D066','1980-10-19','
复制代码 |