Re: Reading a CSV file into a list of dictionaries

2005-06-07 Thread Robert Kern
Laurent RAHUEL wrote: > I thought you knew the number of cols and what you should expect in each. > Then it sounded pretty easy to build a list of dictionaries. If you don't > know what you're supposed to find in your file and how this file is > structured I guess you don't know what you are doing

Re: Reading a CSV file into a list of dictionaries

2005-06-07 Thread Laurent RAHUEL
John Machin wrote: > Laurent RAHUEL wrote: >> RFQ wrote: >> >> >>>Hi, I'm struggling here to do the following with any success: >>> >>>I have a comma delimited file where each line in the file is something >>>like: >>> >>>PNumber,3056,Contractor,XYZ Contracting,Architect,ABC Architects,... >> >

Re: Reading a CSV file into a list of dictionaries

2005-06-07 Thread John Machin
Laurent RAHUEL wrote: > RFQ wrote: > > >>Hi, I'm struggling here to do the following with any success: >> >>I have a comma delimited file where each line in the file is something >>like: >> >>PNumber,3056,Contractor,XYZ Contracting,Architect,ABC Architects,... > > > This is NOT a CSV file. A CS

Re: Reading a CSV file into a list of dictionaries

2005-06-07 Thread Laurent RAHUEL
RFQ wrote: > Hi, I'm struggling here to do the following with any success: > > I have a comma delimited file where each line in the file is something > like: > > PNumber,3056,Contractor,XYZ Contracting,Architect,ABC Architects,... This is NOT a CSV file. A CSV file would be : PNumber,Contracto

Re: Reading a CSV file into a list of dictionaries

2005-06-07 Thread GMane Python
Sounds like you want to use the ConfigObject module. http://www.voidspace.org.uk/python/modules.shtml#configobj -dave "RFQ" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, I'm struggling here to do the following with any success: > > I have a comma delimited file where each lin

Re: Reading a CSV file into a list of dictionaries

2005-06-06 Thread Peter Otten
RFQ wrote: > I have a comma delimited file where each line in the file is something > like: > > PNumber,3056,Contractor,XYZ Contracting,Architect,ABC Architects,... > > So each line is intended to be: key1,value1,key2,value2,key3,value3... > and each line is to be variable in length (although it

Re: Reading a CSV file into a list of dictionaries

2005-06-06 Thread Robert Kern
RFQ wrote: > Hi, I'm struggling here to do the following with any success: > > I have a comma delimited file where each line in the file is something > like: > > PNumber,3056,Contractor,XYZ Contracting,Architect,ABC Architects,... > > So each line is intended to be: key1,value1,key2,value2,key3,