Replace in large text file ?

Gabriele Lanaro gabriele.lanaro at gmail.com
Sat Jun 5 11:24:55 EDT 2010


A module designed to do this is fileinput:

http://docs.python.org/library/fileinput.html

The approach is the same as the other except that it's in the standard
library.

2010/6/5 Paul Rubin <no.email at nospam.invalid>

> Steve <vvw25w at googlemail.com> writes:
> > Remove all comma's
> > Replace all @ with comma's
> > Save as a new file.
>
> The simplest way is just copy the file one character at a time, making
> replacements to commas and @'s as stated.  That will be a bit slow
> (especially in Python) but if you only have to do it once, just wait it
> out.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100605/a777b05a/attachment.html>


More information about the Python-list mailing list