#! /usr/bin/env python
#coding=utf-8
import os
fin=open("c:/aa.txt","rb+")
fout=open("c:/bb.txt","wb+")
j=os.path.getsize("c:/aa.txt")
temp=''
for i in range(0,j):
s=fin.read(1).encode("hex")
if s=="0a" :
if temp=="0d" :
fout.write(s.decode("hex"))
temp=s
else:
fout.write(s.decode("hex"))
temp=s
fout.close()
fin.close()
浙公网安备 33010602011771号