python 去除txt文本中的空格、數字、特定字母等

使用場景:須要去除txt文本中的空格、數字、特定字母等。python 須要修改的txt文本叫作:train.txt 修改以後保存成:train_output.txtweb # ecoding=utf-8 ifn = r"train.txt" ofn = r"train_output.txt" infile = open(ifn,'r') outfile = open(ofn,'w') # 在使用
相關文章
相關標籤/搜索