【发布时间】:2015-07-30 15:07:07
【问题描述】:
我正在准备一些 Whatsapp 聊天日志,用于渲染统计数据和 wordcloud。然而,我的数据时不时地有双换行符,这与日志的格式相混淆,我想知道如何自动修复。
13 Mar 18:51 - nicola: mainly he's crap
13 Mar 18:52 - Sebastian K: ... you didn't really dress it up
13 Mar 18:52 - nicola: and he has no natural grace like most cats
well no i didn't lol
13 Mar 18:52 - nicola: you saw the last video
13 Mar 18:53 - Sebastian K: Stilton jumped onto that wall effortlessly while Ched almost killed himself yea...
搜索并删除空行(容易修复)。但是,我仍然留下破坏日期和时间格式的行:
13 Mar 18:51 - nicola: mainly he's crap
13 Mar 18:52 - Sebastian K: ... you didn't really dress it up
13 Mar 18:52 - nicola: and he has no natural grace like most cats
well no i didn't lol
13 Mar 18:52 - nicola: you saw the last video
13 Mar 18:53 - Sebastian K: Stilton jumped onto that wall effortlessly while Ched almost killed himself yea...
目标格式:
13 Mar 18:51 - nicola: mainly he's crap
13 Mar 18:52 - Sebastian K: ... you didn't really dress it up
13 Mar 18:52 - nicola: and he has no natural grace like most cats well no i didn't lol
13 Mar 18:52 - nicola: you saw the last video
13 Mar 18:53 - Sebastian K: Stilton jumped onto that wall effortlessly while Ched almost killed himself yea...
也许解决方案是利用此规则:我需要保留以下模式的换行符:
TEXT *linebreak*
NUMBER(begging of date column)
讨厌的遵循模式:
TEXT *linebreak*
TEXT
如何使用 Notepad++ 修复它?
【问题讨论】:
标签: regex replace notepad++ line-breaks