日期輸出格式轉換
来源:互联网 发布:淘宝店访客量怎么提高 编辑:程序博客网 时间:2024/06/17 07:02
a.txt内容如下
1,asdqwezxc123,2010-01-01 00:00:00
2,ertyeshthgds2,2010-02-02 00:00:00
.
如何将最后一个逗号后面的 2010-01-01 00:00:00
转换成20100101,并复制一份
结果为:
1,asdqwezxc123,20100101,2010-01-01 00:00:00
2,ertyeshthgds2,20100202,2010-02-02 00:00:00
方法1:sed 's//([0-9]*/)-/([0-9]*/)-/([0-9]*/)//1/2/3,&/g' a.txt (思路相當巧妙)
方法2: awk -F, '{x=substr($3,1,4)substr($3,6,2)substr($3,9,2)}{print $1,$2,x,$3}' a.txt (常規思路,字符串截取)
- 日期輸出格式轉換
- ABAP日期格式轉換
- 日期轉字符日期格式
- CONVERT_DATE_FORMAT 轉日期格式
- mongodb存储日期时间格式的数据,并且快速查询出某一个时间段内的数据
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- 日期格式
- Linux 下的几个常用操作
- Linux的高级网络设置
- CDialogBar类使用方法
- ubuntu安装apache+mysql+php和perl DBI
- Wemen and men
- 日期輸出格式轉換
- windbg,in win7 ,donot output news,by default
- 软件测试用例设计步骤
- the session file could not be loaded
- 帝国标签、模板整理贴
- 帝国标签、模板整理贴
- dpkg-reconfigure
- 帝国标签、模板整理贴
- 我的ext写法一:窗口和表单