Ok, I think what you are trying is to get all data in a string list:

import urllib, csv
url=r"http://www.cs.columbia.edu/~joshua/teaching/cs3101/simpsons_diet.csv";
simpsons=urllib.urlopen(url)
reader=csv.reader(simpsons,delimiter=',',quotechar='"')

list_string = []

for char,meal,ate,qty,com in reader:
   if char != 'Character':
      list_string.append("%s %s %s %s %s" % (char, meal, ate, qty, com))

print list_string

Doing something like this you can format all strings as you want and keep
them into a list

2011/3/24 <[email protected]>

> Thanks, what I'm trying to do is extract the data from the csv file, clean
> it to make each line into a sentence.
>
> But for this I think I need to use a dictionary for each and enter the
> words of each columns in one no?
> Sent from my BlackBerry® on the MetroPCS Network
>
> -----Original Message-----
> From: Rafael Durán Castañeda
>        <[email protected]>
> Sender: [email protected]
> Date: Thu, 24 Mar 2011 15:51:34
> To: <[email protected]>
> Subject: Re: [Tutor] Fw: Fw: Parsing data from a csv file [NC]
>
> _______________________________________________
> Tutor maillist  -  [email protected]
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to