1. 替代文本中一些字符(python)

    import re
    import sys
    import os

    fin=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()