Problem in splitting a string

Angelo Secchi secchi at sssup.it
Thu Jul 22 14:40:32 EDT 2004



Thanks, Wes. I would like the tring in my example splitted as:

['','','',and so on,'23','','','"name,surname"','','','',and so on,'\n']

Thanks again

angelo



On Thu, 22 Jul 2004 18:23:56 GMT
wes weston <wweston at att.net> wrote:

> Angelo Secchi wrote:
> > Hi,
> > I have string of numbers and words like
> > 
> > ',,,,,,23,,,asd,,,,,"name,surname",,,,,,,\n'
> > 
> > and I would like to split (I'm using string.split()) it using comma
> > as separator but I do not want to split in two also the
> > "name,surname" field. In other word I would like python in
> > separating fields to skip that particular comma.
> > 
> > How can I do that?
> > 
> > Thanks in advance
> > 
> > Angelo
> > 
> > 
> > 
> > --
> > ========================================================
> >  Angelo Secchi                     PGP Key ID:EA280337
> > ========================================================
> >   Current Position:
> >   Graduate Fellow Scuola Superiore S.Anna
> >   Piazza Martiri della Liberta' 33, Pisa, 56127 Italy
> >   ph.: +39 050 883365
> >   email: secchi at sssup.it	www.sssup.it/~secchi/
> > ========================================================
> 
> Angelo,
>    For example, how how would you want the example given to
> be split?
> wes
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list


--
========================================================
 Angelo Secchi                     PGP Key ID:EA280337
========================================================
  Current Position:
  Graduate Fellow Scuola Superiore S.Anna
  Piazza Martiri della Liberta' 33, Pisa, 56127 Italy
  ph.: +39 050 883365
  email: secchi at sssup.it	www.sssup.it/~secchi/
========================================================



More information about the Python-list mailing list