Re: [Tutor] Malformed CSV

2005-12-02 Thread Jan Eden
Kent Johnson wrote on 02.12.2005: >Jan Eden wrote: >>I guess I need to notify the engineer responsible for the CSV >>output and have the quoting corrected. > >If that is possible it is a much better solution. I hate to hack >around bad data - much better to correct the source of the data if >possi

Re: [Tutor] Malformed CSV

2005-12-02 Thread Kent Johnson
Jan Eden wrote: > I guess I need to notify the engineer responsible for the CSV output > and have the quoting corrected. If that is possible it is a much better solution. I hate to hack around bad data - much better to correct the source of the data if possible. In fact you may have little choic

Re: [Tutor] Malformed CSV

2005-12-02 Thread Jan Eden
Kent Johnson wrote on 02.12.2005: >I'm not entirely sure how you want to interpret the data above. One >possibility is to just change the double "" to single " before >processing with csv. For example: > ># data is the raw data from the whole file >data = '''""hotel,hamburg"","1","0","0" >""hotel,

Re: [Tutor] Malformed CSV

2005-12-02 Thread Kent Johnson
Jan Eden wrote: > Hi, > > I need to parse a CSV file using the csv module: > > "hotel","9,463","95","1.00" > "hotels","7,033","73","1.04" > "hotels hamburg","2,312","73","3.16" > "hotel hamburg","2,708","42","1.55" > "Hotels","2,854","41","1.44" > "hotel berlin","2,614","31","1.19" > > Unfortuna

[Tutor] Malformed CSV

2005-12-02 Thread Jan Eden
Hi, I need to parse a CSV file using the csv module: "hotel","9,463","95","1.00" "hotels","7,033","73","1.04" "hotels hamburg","2,312","73","3.16" "hotel hamburg","2,708","42","1.55" "Hotels","2,854","41","1.44" "hotel berlin","2,614","31","1.19" The idea is to use each single keyword (field 1)