I want to be able to replace a single line in a large text file (several hundred MB). Using the cookbook's method (below) works but I think the replace fxn chokes on such a large chunk of text. For now, I simply want to replace the 1st line (CSV header) in the file but I'd also like to know a more general solution for any line in the file. There's got a be quick and dirty (and cheap) way to do this... any help?
Cookbook's method: output_file.write(input_file.read().replace(stext, rtext)) Thanks, Pythonner -- http://mail.python.org/mailman/listinfo/python-list