I am new to python and am trying to write a python3 script that will edit the content of an existing text file and write it to a new text file. I currently have the following script which creates the new text file from the old one:
path = '/Users/uname/Desktop/soc-calc/TVs+Assigned+to+Local+Markets.txt'
tvfile = open(path,'r')
days = tvfile.read()
new_path = '/Users/uname/Desktop/soc-calc/tvs.txt'
new_days = open(new_path,'w')
new_days.write(days)
print(days)
tvfile.close()
new_days.close()
I have been searching and have been unable to find how I would make the script not only create a new document from the existing one, but remove all instances of the "-" character from the newly created text file.
Any help with what I would need to change or add to accomplish this would be helpful.