I have input files "input.dat" contain some values like this :
41611 2014 12 18 0 0
41615 2014 12 18 0 0
41625 2014 12 18 0 0
41640 2014 6 14 3 3
42248 2014 12 18 0 0
42323 2014 12 18 0 0
42330 2014 8 13 7 7
42334 2014 12 18 0 0
42335 2014 12 18 0 0
...
I have many dataset files but seems so many unwanted data How to delete many rows for this case 41640 and 42330 and its entire row values at instant. For now I used this script:
with open(path+fname,"r") as input:
with open("00-new.dat","wb") as output:
for line in input:
if line!="41640"+"\n":
output.write(line)
The result: The data 41640 is still exist in output. Any ideas??