好友
阅读权限10
听众
最后登录1970-1-1
|
蒋阿君
发表于 2023-8-23 14:48
本帖最后由 蒋阿君 于 2023-8-23 14:51 编辑
目的:把杂乱文本处理为想要的格式
杂乱文本:
[Asm] 纯文本查看 复制代码 08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX93 value: 0000100000000000000000000000000000000000 -> 0000100000000000000000000000000000000000
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX94 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX95 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX96 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX97 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX98 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX99 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX100 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX101 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX102 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX103 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX104 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX105 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX106 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX107 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX108 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX109 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX110 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX111 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX112 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX113 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX114 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX115 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX116 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX117 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX118 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX119 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX120 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX121 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX122 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX123 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX124 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX125 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX126 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX127 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX128 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX129 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX130 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX131 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX132 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX133 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX134 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX135 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX136 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX137 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX138 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX139 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX140 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX141 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: 哈杭州3 key: CDX142 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX1 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX2 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX3 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX4 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX5 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX6 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX7 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX8 value: [-] -> [-]
08-18 10:58:24 [Info] [GET] table: key: CDX9 value: [-] -> [-]
目标格式:
[Asm] 纯文本查看 复制代码 存档保存("CDX94","")
存档保存("CDX95","")
存档保存("CDX96","")
存档保存("CDX97","")
存档保存("CDX98","")
参考教学视频:https://www.bilibili.com/video/BV1G54y1R7zS/?vd_source=8431021b53d9b3de0f3a9a1b29cd6942
程序中使用的正则表达式:
[Asm] 纯文本查看 复制代码 “table: (.*?)\n|key: (.*?)\n| value: (.*?)\n”
程序分步运行:
这个时候是可以正常取到文本数据的
目前遇到问题:在进行正则替换时取不到数据,如下图所示
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|