nhờ cao thủ chỉ giúp
mình cần lọc file
237661518623
237664999368
237661702285
237664793602
237664947557
237668634280
237663634407
237666634441
237668634475
237667633622
237668633769
chia thành 2 file
mình chỉ có thể ghi vào 2 file nhưng bị ghi đè lên nhau , nhờ cao thủ chỉ giúp
=======================script==================================
from sys import argv
script, from_file, to_file1, to_file2 = argv
in_file = open(from_file,'r')
a = in_file.readlines()
for i in a:
if (int(i) >= 237660000000 and int(i) <= 237666999999):
print"write file 1 "
out_file1 = open(to_file1,'w')
out_file1.write(i + "\n")
else:
print "write file 2"
out_file2 = open(to_file2,'w')
out_file2.write(i+ "\n")
print " all file sucess"
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?