it saving a text file but the file was empty please help me, I think the error happen in the while loop? I already try for loop but it result in infinite loop
with open('F:\\datamining\\Textmining\\Coded\\newlist.txt') as fp:
line = fp.readline()
cnt=1
f=open('F:\\datamining\\Textmining\\Coded\\Lastlist.txt','w')
while line:
data=line.strip()
if data in words :
print(data)
f.write(data+"\n")
line=fp.readline()
cnt += 1