Help with mass remove in text file

Peter Hansen peter at engcorp.com
Wed Jul 13 18:05:11 EDT 2005


rorley at gmail.com wrote:
> I'm trying to open a text file, remove all instances of the words
> "f=x;" and "i=x;" where x can be any number 0-14.  Also, I want to
> remove all {   " or ) or ( or '   } each time one of those characters
> occurs respectively.  This is what I've been able to piece together...

See the thread titled "String Manipulation" which your classmate "jen" 
started, which has several useful answers already.

Hopefully others will note that this is homework as well and not totally 
hand you the answer on a platter, so you'll actually learn something. 
Kudos to you for actually attempting it and posting your code though. ;-)

-Peter



More information about the Python-list mailing list