我不确定这将如何在 unix 中完成,任何人都可以帮助/建议
2012-05-03T25:00:00 to 2012-05-04T01:00:00
在 Unix 命令/脚本中进行转换
在我的文件中,我有不止一次出现,需要转换到第二天的不同时间
2012-05-03T25:00:00 to 2012-05-04T01:00:00
2012-05-03T26:50:00 to 2012-05-04T02:50:00
2012-05-03T31:59:59 to 2012-05-04T07:59:59
ETC
我试过了,但不知何故 sed 不起作用
日期.txt
2009-09-12T05:18:@00@+10:00,D,
2009-09-12T05:24:00+10:00,2009-09-12T05:24:@00@+10:00,D,
2009-09-12T05:25:00+10:00,2009-09-12T05:25:@00@+10:00,D,
2009-09-12T05:27:00+10:00,2009-09-12T05:27:@00@+10:00,D,
2009-09-12T30:29:00+10:00,2009-09-12T05:29:@00@+10:00,D,
2009-09-12T29:31:00+10:00,2009-09-12T05:31:@00@+10:00,D,
2009-09-12T28:33:00+10:00,,D,
2009-09-12T27:00:@00@+10:00,U,
2009-09-12T26:01:00+10:00,2009-09-12T05:01:@00@+10:00,U,
2009-09-12T24:04:00+10:00,2009-09-12T05:04:@00@+10:00,U,
2009-09-12T24:59:59+10:00,2009-09-12T05:06:@00@+10:00,U,
2009-09-12T30:08:00+10:00,2009-09-12T05:08:@00@+10:00,U,
2009-09-12T31:59:59+10:00,2009-09-12T05:10:@00@+10:00,U,
2009-09-12T05:17:00+10:00,,U,
2009-09-12T25:25:@00@+10:00,D,
脚本.sh
awk -F"T" -v OFS=',' '{print $1}' date.txt > tmpdate
uniq -d tmpdate > tmpuniq
rm tmpdate
date1=`cat tmpuniq`
date2=`date --set="$date1" +%F`
date3=$(date --date="$date2" -d "+1 day" +"%F")
T1=$date2+"T24"
T2=$date3+"T00"
echo $T1
echo $T2
dos2unix date.txt
#sed -i 's/$T1/$T2/g' date.txt > test.txt
#sed -i 's/"$T1"/"$T2"/g' date.txt > test.txt
sed -i 's/'$T1'/'$T2'/g' date.txt
非常感谢任何帮助