Something like this might do the trick:<br><br>import re<br>f  = open("file.txt")<br>old_text = f.readlines()<br>f.close()<br>new_text = [re.sub(r'.\b', '', i) for i in old_text]<br>f = open("file_modified.txt", "w")<br>

f.writelines(new_text)<br><br>I don't know how necessary the separate read and writes are, but it'll be good for a start. At any rate, you'll want to look at the <a href="http://docs.python.org/lib/module-re.html">re</a> module.<br>
<br><div class="gmail_quote">On Thu, Jun 26, 2008 at 16:32,  <<a href="mailto:cakomo@gmail.com" target="_blank">cakomo@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi<br>
I am a beginner on Python and have a problem..<br>
<br>
I have text file and reading it line by line and there are backspace<br>
characters in it like '\b' or anything you want like "#".  I want to<br>
replace these chars. with Backspace action. I mean deleting the<br>
previous char. and the \b char also. and writing all cleaned text to a<br>
file again.<br>
<br>
How can I do that.<br>
<br>
Thanks..<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>