slow loop?
maney at pobox.com
maney at pobox.com
Thu Jan 16 14:01:12 EST 2003
Peter Hansen <peter at engcorp.com> wrote:
> maney at pobox.com wrote:
>> for l in someFile.xreadlines():
>> fields = csv.split(l)
>> ...
>
> I haven't reviewed the code, but with the above line driving it, it
> doesn't seem likely it can handle any lines with embedded newlines,
> which can easily occur in a CSV file (at least, those written by Excel
> for one).
Interesting. Because mmost of what I'm parsing comes from Excel
spreadsheets. Perhaps its because I use OpenOffice to dump them to
CSV - at least IME it does a better job of not dumping unwanted empty
columns. Oh well, I know where I can get a more Excel-compatible
parser if I need it, though having to get that installed everywhere
will be a nuisance.
> Might be great for some people though. Nice and simple.
That's me. Why, I invented "do the simplest thing" *decades* before
those gen-X folks came along! <really big grin>
More information about the Python-list
mailing list