strange problem

Steve Holden steve at holdenweb.com
Wed Oct 25 02:05:17 CEST 2006


ken wrote:
> This file has 1,000,000+ lines in it, yet when I print the counter 'cin' 
> at EOF I get around 10,000 less lines. Any ideas?
> 
>     lineIn = 
> csv.reader(file("rits_feed\\rits_feed_US.csv",'rb'),delimiter='|')
>      for emp in lineIn:
>          cin=cin+1
>      print cin

My psychic powers indicate that double-quotes in the data are the most 
likely source of your problem. You may need to extract some statistics 
from the data to find out what's going on without examining each record 
individually.

Like, for example, longest field-length for each column.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list