日期的字符串操作 [英] String manipulation for a date

查看:63
本文介绍了日期的字符串操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文件包含以下内容......

A file contains the following contents ...

展开 | 选择 | Wrap | 行号

推荐答案

那里没有perl命令可以做到这一点但你可以使用正则表达式来捕获字符串/行的日期部分(或者可能是另一种方式,具体取决于实际数据的方式)并使用unpack(或正则表达式)和sprintf重新格式化它你想要的。
There is no perl command to do that but you could use a regexp to capture the date part of the string/line (or maybe another way depending on how the actual data is) and use unpack (or a regexp) and sprintf to reformat it like you want.


正则表达式是什么样的?
What would the regular expression look like?


@ joeferns79


可能类似于:

@joeferns79
probably something like:

展开 | 选择 | Wrap | 行号


这篇关于日期的字符串操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆