paceboard/scripts/utils/file.py
2021-06-23 19:38:47 -04:00

10 lines
268 B
Python

### Util library for general file handling
def replaceTextInFile(filepath, oldText, newText):
file = open(filepath, "rt")
newFile = file.read().replace(oldText, newText)
file.close()
file = open(filepath, "wt")
file.write(newFile)
file.close