f1=open("OldFile.txt","r") //Opening old file from which we will fetch the data
f2=open("NewFile.txt","w") //Opening new file to store the remaining data of old filewhile True:
text=f1.readline() //fetching data to a variable from old file
if text[0]=="#": //here you can change the comparing condition #,*,@,&
continue
f2.write(text)
f2.close()
f1.close()
f1=open("NewFile.txt","r")
print(f1.read())
f1.close()
No comments:
Post a Comment