是否可以将转换d.m.Y h:m:s转换为Y-d-m h:m:s以获取Linux中的大文件?
示例数据
"30.07.2016 00:00:00",DN123,PAPN,PAPN,TEST,918945,
想转换为
"2016-07-30 00:00:00",DN123,PAPN,PAPN,TEST,918945,
答案 0 :(得分:0)
假设您的文件名为A.csv
使用以下内容:
awk -F"," '{print "\""substr($1,08,4)"-"substr($1,5,2)"-"substr($1,2,2)substr($1,12,9)"\","$2","$3","$4","$5","$6","}' A.csv > A.csv_new
然后,您可以用旧的
替换新文件mv A.csv_new A.csv