open file find and replace commas python code example
Example: open file find and replace commas python
with open('outputFile', 'r+') as f:
text = f.read()
f.seek(0)
f.truncate()
f.write(text.replace('(comma)', ' , '))
with open('outputFile', 'r+') as f:
text = f.read()
f.seek(0)
f.truncate()
f.write(text.replace('(comma)', ' , '))