我需要重新格式化类似格式的日志文件,并且一直在使用 Notepad++ 宏。
例子:
[00:55:48] Profile Information:
[00:55:48] Name: Joe Bloggs
[00:55:48] Age: 21
[00:55:48] Profile Information:
[00:55:48] Name: Joe Bloggs 2
[00:55:48] Age: 22
Run Code Online (Sandbox Code Playgroud)
我需要的格式是:
Joe Bloggs
21
Joe Bloggs 2
22
Run Code Online (Sandbox Code Playgroud)
我可以在宏中使用以下操作来做到这一点,但这只能让我到目前为止。
删除时间戳 [[^[]]*]
删除空行 编辑 > 行操作 > 删除空行
将以下内容替换为空名称: 年龄:
然后我需要选择每一个说,第二行并删除其他所有内容,所以我会留下每第二行的列表 - 类似于:
21
22
Run Code Online (Sandbox Code Playgroud)
希望更熟悉 Regex 等的人可以提供指导和建议。
notepad++ ×1