删除此字符串 ^[[38;1H^[[K^[[7m71%^[[27m^[[38;1H^[[38;1H^[[K
remove this string ^[[38;1H^[[K^[[7m71%^[[27m^[[38;1H^[[38;1H^[[K
我正在尝试从文本文件中删除 vim
显示的以下字符串
^[[38;1H^[[K^[[7m71%^[[27m^[[38;1H^[[38;1H^[[K
在这个文本文件中我有 7m1000 个条目
意义
^[[38;1H^[[K^[[7m71%^[[27m^[[38;1H^[[38;1H^[[K
^[[38;1H^[[K^[[7m72%^[[27m^[[38;1H^[[38;1H^[[K
^[[38;1H^[[K^[[7m73%^[[27m^[[38;1H^[[38;1H^[[K ...
^[[38;1H^[[K^[[7m1000%^[[27m^[[38;1H^[[38;1H^[[K
我试过 cat/grep/sed..
我尝试使用以下脚本
def Process(data):
text = data.split()[0]
#print repr(text)
text = re.sub('[%s]' % re.escape(string.punctuation), '', text)
data.split()[0]= text
return data
生产中
:python Clo.py
IP: 138.42.153.194->10.132.136.42, protocol 6, [38;1H[K[7m86%[27m[38;1H[38;1H[KTCP: sport 3389, dport 58187, seq 978549389, ack 33554488, flags 0x0018 ( ACK PSH), urgent data 0, Flow fastpath, session 911218, wqe index 487973 packet 0x0x80000000416988e6, Packet info: len 107 port 17 interface 17 vsys 0, Packet from interface 256 forwarded to DP0 for tunnel encap
是否可以删除 ["'\x1b[38;1H\x1b[K\x1b[7m######%\x1b[27m\x1b[38; 1H\x1b[38;1H\x1b[KTCP:] 直接从 VI?
我的解决方案是
:%s/^[.*^[//g
我正在尝试从文本文件中删除 vim
显示的以下字符串^[[38;1H^[[K^[[7m71%^[[27m^[[38;1H^[[38;1H^[[K
在这个文本文件中我有 7m1000 个条目 意义
^[[38;1H^[[K^[[7m71%^[[27m^[[38;1H^[[38;1H^[[K ^[[38;1H^[[K^[[7m72%^[[27m^[[38;1H^[[38;1H^[[K ^[[38;1H^[[K^[[7m73%^[[27m^[[38;1H^[[38;1H^[[K ... ^[[38;1H^[[K^[[7m1000%^[[27m^[[38;1H^[[38;1H^[[K
我试过 cat/grep/sed..
我尝试使用以下脚本
def Process(data):
text = data.split()[0]
#print repr(text)
text = re.sub('[%s]' % re.escape(string.punctuation), '', text)
data.split()[0]= text
return data
生产中
:python Clo.py
IP: 138.42.153.194->10.132.136.42, protocol 6, [38;1H[K[7m86%[27m[38;1H[38;1H[KTCP: sport 3389, dport 58187, seq 978549389, ack 33554488, flags 0x0018 ( ACK PSH), urgent data 0, Flow fastpath, session 911218, wqe index 487973 packet 0x0x80000000416988e6, Packet info: len 107 port 17 interface 17 vsys 0, Packet from interface 256 forwarded to DP0 for tunnel encap
是否可以删除 ["'\x1b[38;1H\x1b[K\x1b[7m######%\x1b[27m\x1b[38; 1H\x1b[38;1H\x1b[KTCP:] 直接从 VI?
我的解决方案是
:%s/^[.*^[//g