我想从所有行
问题描述:
例如删除所有日期我想从所有行
04/06/2017, 6:48:03 PM: hey
04/06/2017, 6:48:19 PM: hello
04/06/2017, 9:04:29 PM: whats up
04/06/2017, 9:54:57 PM: nothing much
04/06/2017, 11:19:23 PM: yeah
13/07/2017, 10:33:24 PM: because im kinda bored right now
13/07/2017, 10:41:08 PM: no really?
13/07/2017, 10:55:22 PM: fuck yes
23/07/2017, 4:36:17 AM: do you want to accept jesus christ as your god?
23/07/2017, 4:36:32 AM: sure give me Rope to tie it for you >:)
我要删除的日期和时间,它的自我,我有超过1K行所以是那里有很多的日期和时间之间diffrences的,怎么可能我清除所有的日期和时间,并留下文字它的自我
hey
hello
whats up
nothing much
yeah
because im kinda bored right now
no really?
fuck yes
do you want to accept jesus christ as your god?
sure give me Rope to tie it for you >:)
这个
答
使用记事本++
- 按Ctrl + H^
- 查找内容:
^\d{2}/\d{2}/\d{4}, \d{1,2}:\d{2}:\d{2} [AP]M:\h+
- 替换:
LEAVE EMPTY
- 更换所有
说明:
^ : start of line
\d{2} : 2 digits
/ : a slash
\d{2} : 2 digits
/ : a slash
\d{4} : 4 digits
, : a comma
\d{1,2} : 1 or 2 digits
: : colon
\d{2} : 2 digits
: : colon
\d{2} : 2 digits
[AP]M: : A or P followed by M and a colon
\h+ : 1 or more horizontal space
- 检查线上缠绕
- 检查正则表达式
结果为给定的例子:
hey
hello
whats up
nothing much
yeah
because im kinda bored right now
no really?
fuck yes
do you want to accept jesus christ as your god?
sure give me Rope to tie it for you >:)
答
使用冒号作为字段分隔符,打印从4场
cut -d : -f 4- file
加你尝试过什么。 –
有人希望在发布问题之前尝试尝试。另外,使用更中性和专业的示例文本文件肯定不会太麻烦? – halfer