1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from os import *
from io import *
for root, dirs, files in walk("."):
for name in files:
headerPath = path.join(root, name)
if name.endswith(".txt"):
# open file to read alllines
fr = open(headerPath, 'r')
lines = fr.readlines()
fr.close()
# open file to process write line
fp = open(headerPath, 'w')
for line in lines:
line = line.replace('*','-')
fp.write(line)
fp.close()
|