alex23 wrote:
On Aug 12, 12:03 pm, Brad <[EMAIL PROTECTED]> wrote:
So let's say I want to edit this file and change Volume from 940 to 950.

Personally, I'd recommend avoiding re and sticking with the standard
string functions.

Something like this should be pretty effective:

open('outfile','w').writelines(l.replace('Volume 940','Volume 950') for l in 
open('myfile','r'))

Ahh yes, perhaps string function are simpler to use in this case.
Thanks Alex!
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to