5 Subst = {} # map of desired substitutions
9 matchingS = "\\b|\\b".join(Subst.keys())
10 pattern = "".join(["(.*)(\\b", matchingS, "\\b)(.*)"])
11 return re.compile(pattern)
13 def SubstituteDataInLine(line):
15 m = prog.match(result)
17 return "".join([SubstituteDataInLine(m.group(1)),
19 SubstituteDataInLine(m.group(3))])
23 def SubstituteDataInFile(InFile):
24 for line in open(InFile):
25 print SubstituteDataInLine(line[:-1])
27 ##########################################
32 del args[0] # we don't need the name ot this script
35 entry = args[0].split("=",1)
43 SubstituteDataInFile(args[0])