-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove_duplic.py
More file actions
38 lines (28 loc) · 1.43 KB
/
remove_duplic.py
File metadata and controls
38 lines (28 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
types = ["C"]
taille = ["100"]
UB = ["2","8","20","60","100","200"]
info = ["0","1","2","3","4","5","6","7"]
path = "./Data/Population2/"
methodes = ["MOLS_PSize","MOLS_PSize_DIV/OS"]
for t in types:
for ta in taille:
for i in range(0,10):
for m in methodes:
for u in UB:
for step in info:
filename = path+t+"/"+ta+"/T"+str(i)+"/"+m+"/"+u+"/"+step+"/"
for fic in os.listdir(filename):
# print filename+fic
f = open(filename+fic, "r")
lines = f.readlines( )
first = True
for id_line,l in zip(range(0,len(lines)),lines):
split_line = l.split()
if len(split_line) > 1 and split_line[3] == '0' and first :
first = False
elif len(split_line) > 1 and split_line[3] == '0' and first == False:
print ("found")
with open(filename+fic, "w") as f_write :
f_write.writelines(lines[0:id_line -1 ])
break