On Fri, 29 Apr 2005 23:21:43 +0100, Michael Hoffman <[EMAIL PROTECTED]> wrote:
>John Machin wrote: >> [Michael Hoffman]: >> >>>for row in csv.reader(fileinput.input()): >> >> csv.reader requires that if the first arg is a file that it be opened >> in binary mode. > >fileinput.input() is not a file. Hair-splitter. fileinput opens its files in text mode. It's an awk simulation and shouldn't be used for real-world data. > >I have tested this code and it works fine for the provided example. Well I've got news for you: real-world data has embedded CRs, LFs and (worst of all) ^Zs often enough, and you won't find them mentioned in any documentation, nor find them in examples. -- http://mail.python.org/mailman/listinfo/python-list