Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread Tim Chase
On 11/21/11 09:16, ray wrote: Is there a way to capture the keys outside of the for loop so when the for loop is entered, only data is extracted? I frequently do this for things like tweaking headers (stripping space, normalizing case, etc because clients love to send us messy data): def

Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread Neil Cerutti
On 2011-11-21, Neil Cerutti wrote: > On 2011-11-21, ray wrote: >> Is there a way to capture the keys outside of the for loop so >> when the for loop is entered, only data is extracted? > > I have sometimes done the following type of thing, since > DictReader doesn't offer an attribute providing t

Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread Neil Cerutti
On 2011-11-21, ray wrote: > Is there a way to capture the keys outside of the for loop so > when the for loop is entered, only data is extracted? I have sometimes done the following type of thing, since DictReader doesn't offer an attribute providing the field names. This is Python 3.3.2 code, so

Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread ray
On Nov 21, 7:59 am, Neil Cerutti wrote: > On 2011-11-21, ray wrote: > > > I am trying to get the data from a CSV file into variables.  I have > > used DictReader to get the field names and I can report them.  When I > > attempt to look at the data, every row shows the combination of > > fieldname

Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread Neil Cerutti
On 2011-11-21, ray wrote: > I am trying to get the data from a CSV file into variables. I have > used DictReader to get the field names and I can report them. When I > attempt to look at the data, every row shows the combination of > fieldname:data. How do I get the data out? > linelist=open( "

How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread ray
I am trying to get the data from a CSV file into variables. I have used DictReader to get the field names and I can report them. When I attempt to look at the data, every row shows the combination of fieldname:data. How do I get the data out? linelist=open( "C:/Users/rjoseph/Documents/Projects/B