-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoveHeader.py
More file actions
23 lines (20 loc) · 803 Bytes
/
RemoveHeader.py
File metadata and controls
23 lines (20 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
filelist1=os.listdir('/home/ubuntu/MLDATA/diff')
for name in filelist1:
filelist=os.listdir('/home/ubuntu/MLDATA/diff/'+name)
for file in filelist:
try:
with open('/home/ubuntu/MLDATA/diff/'+name+'/'+file) as codefile:
print('/home/ubuntu/MLDATA/diff/'+name+'/'+file)
lines=codefile.readlines()
print(1)
os.popen('mkdir -p /home/ubuntu/MLDATA/SPLITTED/'+name)
print(2)
aimedfile=open('/home/ubuntu/MLDATA/SPLITTED/'+name+'/'+file,'w')
print(3)
for line in lines:
if(not line.strip().startswith('#')):
aimedfile.write(line)
aimedfile.close()
except:
pass