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(

Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread Neil Cerutti
On 2011-11-21, ray r...@aarden.us 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?

Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread ray
On Nov 21, 7:59 am, Neil Cerutti ne...@norwich.edu wrote: On 2011-11-21, ray r...@aarden.us 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

Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread Neil Cerutti
On 2011-11-21, ray r...@aarden.us 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

Re: How to: Coordinate DictReader and Reader for CSV

2011-11-21 Thread Neil Cerutti
On 2011-11-21, Neil Cerutti ne...@norwich.edu wrote: On 2011-11-21, ray r...@aarden.us 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

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