Split string first data have ",

Nick Cash nick.cash at npcinternational.com
Tue Jan 29 18:07:18 CET 2013


> >>> y = '"abc.p,zip.p",a,b'
> >>> print y
> "abc.p,zip.p",a,b
> >>>

>>> x = "what is your question??"
>>> print x

I'm guessing that you want to split on ",", but want the quoted section to be a single token? 
Have you looked at the CSV module (http://docs.python.org/3/library/csv.html)?

If my guess is wrong, or you're having difficulties with the csv module, a more specific question will help you get the answer you're looking for.

-Nick Cash




More information about the Python-list mailing list