替代文本中一些字符(python)
import re
import sys
import osfin=open(r'E:\test\PythonTest\1.txt','r')
fout=open(r'E:\test\PythonTest\2.txt','a')a=fin.read()
while(a !=''):
while re.search(r"[0-9]*:",a) :
a=re.sub(r"[0-9]*:",r'\n',a,1)
fout.write(a)
a=fin.read()
替代文本中的字符-python
原创
©著作权归作者所有:来自51CTO博客作者a_liujin的原创作品,谢绝转载,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Python去除中文文本中的特殊字符
【代码】Python去除文本中的特殊字符。
python 开发语言 细粒度 模态 相似度