Hi there, im trying to create a python program that can read a text file line by line and search for specified words/text/strings and remove them from the text file. Then finally save the modified text file to an output file. The only problem is, the text file contains code for a BACKSPACE typed in the text. e.g. "<BACKSPACE& gt;" this needs to be removed which sounds quite simple, but often there are numbers involved. e.g. "<BACKSP ACE: 4>" which would represent 4 backspaces, and so the string needs to be removed and 4 backspaces take place on the text before the code. e.g. "repatre<BAC KSPACE: 4>resent" would become "represent" I know a search and delete script that can search for a word at the beggining of the line and then delete the whole line, but im not sure about this. Any ideas would be great.
Cheers,
Joe
Cheers,
Joe
Comment