Split string data have ","

moonhkt moonhkt at gmail.com
Tue Jan 29 21:21:59 EST 2013


On Jan 30, 1:08 am, Chris Rebert <c... at rebertia.com> wrote:
> On Jan 29, 2013 9:05 AM, "moonhkt" <moon... at gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
> > Hi All
>
> > Python 2.6.2 on AIX 5.3
> > How to using split o
>
> > >>> y = '"abc.p,zip.p",a,b'
> > >>> print y
> > "abc.p,zip.p",a,b
>
> > >>> k= y.split(",")
> > >>> print k[0]
> > "abc.p
>
> > Need Result, First element is
> > abc.p,zip.p
>
> Try the csv module or the shlex module.

Thank a lot, Using csv is good for me.



More information about the Python-list mailing list