>
>
> I am trying to write a script that will take the CSV file and output
> another text file as follows:
>
> ID   Products
> 1    a
> 1    b
> 1    c
> 1    d
> 1    a
> 1    e
>
> etc.. for all of the ID's essentially I need to create a single instance
> for products for each ID - currently the products are separated by a space.
> I am thinking I need a for loop that will search on the space as a
> delimiter...
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
If your goal is to separate 'a b c d' using space as a delimiter, just use
'a b c d'.split()
This returns ['a', 'b', 'c', 'd']

Ian.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to