#coding=utf-8 """ anthor:wanggang date:Jan,7,2020 """ str='' path='C:\\Users\\Administrator\\Desktop\\过度用\\dealdata.txt' file=open('testmid.txt','w',encoding='utf-8') f=open(path,'r',encoding='utf-8') for i in f.readlines(): if len(i)==1:#这个1这里认为是'\n' continue else: file.write(i) file.close()
去除文本中的空行
最新推荐文章于 2024-07-05 03:38:52 发布