I want to recursively search through a directory with subdirectories of text files and replace every occurrence of {$replace} within the files with the contents of a multi l
import glob
for allfiles in glob.glob('*.txt'):
for line in open(allfiles,'r'): change=line.replace("old_string","new_string") output=open(allfiles,'w') output.write(change)