On Fri, 02 May 2008 04:14:47 -0700, Jetus wrote:

> I have a comma delimited file that is separated by comma's, and then
> sometimes by ","
> 
> c:\temp\05-06-08\Sale1,659 CECIL,"659 CECIL,40211",
> 1,659,CECIL,AVENUE,LOUISVILLE,40211,"$65,276.78 "
> c:\temp\05-06-08\Sale2,637 SOUTH 27TH,"637 SOUTH 27TH,40211",
> 2,637,SOUTH 27TH,STREET,LOUISVILLE,40211,"$45,456.95 "
> c:\temp\05-06-08\Sale3,2709 ELLIOT,"2709 ELLIOT,40211",
> 3,2709,ELLIOT,AVENUE,LOUISVILLE,40211,"$49,349.66 "

The items are always delimited by commas but some items themselves contain
a comma and therefore are enclosed in double quotes.  So it's not
inconsistent.

> How do I convert that line into a list?

Use the `csv` module in the standard library.

Ciao,
        Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to