小编Lap*_*rrl的帖子

从巨大的文本文件中剥离文本块

我的任务非常痛苦,我想知道是否有人可以提供帮助.

我们的供应商提供了一个SNMP mib文件(txt).不幸的是,这个文件很多都已经过时,需要为我们的监控应用程序删除.

我一直在尝试手工完成这项工作,但它已超过800,000行,并且它正在削弱我的生存意愿.

结构类似于:

-- /*********************************************************************************/
-- /* MIB table for Hardware                                                        */
-- /* Valid from: 543.44                                                            */
-- /* Deprecated from: 600.3                                                        */
-- /*********************************************************************************/

Some text 
some text 
Some text

-- /*********************************************************************************/
-- /* MIB table for Hardware                                                        */
-- /* Valid from: 543.44                                                            */
-- /*********************************************************************************/

Some text 
some text 
Some text

-- /*********************************************************************************/
-- /* MIB table for Hardware                                                        */
-- /* Valid from: 364.44                                                            */
-- /* Deprecated from: 594.3                                                        */
-- /*********************************************************************************/ …
Run Code Online (Sandbox Code Playgroud)

awk sed

6
推荐指数
1
解决办法
180
查看次数

标签 统计

awk ×1

sed ×1