snip...
>
>    for counter, line in enumerate(fileIN):
>        newline = line.replace(oldstring, newstring)
>        if newline != line:
>            print 'match at line', counter+1
>        fileOUT.write(newline)

"enumerate" - haven't seen that before. Nice!

Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to