- 论坛徽章:
- 0
|
回复 #4 独行虾 的帖子
额,理解错了。。。
awk -F ' +|-' '{sub($1"-"$2"-"$3" ",$1"-"$2"-"sprintf("%02d ",$3+1));print >"sn"NR}' file
日期都+1
- [root@Mylinux tmp]# cat file
- 2009-03-26 00:05:08 W3SVC517896918 211.155.25.56 GET /08mrzx/shows/27/one_52277.shtml - 80 - 61.135.249.206 Mozilla/5.0
- 2009-03-22 00:05:08 W3SVC517896918 211.155.25.56 GET /08mrzx/shows/27/one_52277.shtml - 80 - 61.135.249.206 Mozilla/5.0
- [root@Mylinux tmp]# awk -F ' +|-' '{sub($1"-"$2"-"$3" ",$1"-"$2"-"sprintf("%02d ",$3+1));print >"sn"NR}' file
- [root@Mylinux tmp]# cat sn1
- 2009-03-27 00:05:08 W3SVC517896918 211.155.25.56 GET /08mrzx/shows/27/one_52277.shtml - 80 - 61.135.249.206 Mozilla/5.0
- [root@Mylinux tmp]# cat sn2
- 2009-03-23 00:05:08 W3SVC517896918 211.155.25.56 GET /08mrzx/shows/27/one_52277.shtml - 80 - 61.135.249.206 Mozilla/5.0
复制代码
[ 本帖最后由 ywlscpl 于 2009-6-4 16:57 编辑 ] |
|