Problem in splitting a string
From: Angelo Secchi (secchi_at_sssup.it)
Date: 07/22/04
- Next message: Richard Brodie: "Re: string.encode on HP-UX"
- Previous message: Jeff Shannon: "Re: [wxPython] Smileys in my text ctrl"
- Next in thread: wes weston: "Re: Problem in splitting a string"
- Reply: wes weston: "Re: Problem in splitting a string"
- Reply: wes weston: "Re: Problem in splitting a string"
- Reply: Jens Thiede: "Re: Problem in splitting a string"
- Maybe reply: Dave Brueck: "Re: Problem in splitting a string"
- Reply: Peter Otten: "Re: Problem in splitting a string"
- Reply: Jeff Shannon: "Re: Problem in splitting a string"
- Reply: Paul McGuire: "Re: Problem in splitting a string"
- Maybe reply: Terry Reedy: "Re: Problem in splitting a string"
- Reply: Byron: "Re: Problem in splitting a string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 22 Jul 2004 20:16:32 +0200 To: python-list@python.org
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@sssup.it www.sssup.it/~secchi/ ========================================================
- Next message: Richard Brodie: "Re: string.encode on HP-UX"
- Previous message: Jeff Shannon: "Re: [wxPython] Smileys in my text ctrl"
- Next in thread: wes weston: "Re: Problem in splitting a string"
- Reply: wes weston: "Re: Problem in splitting a string"
- Reply: wes weston: "Re: Problem in splitting a string"
- Reply: Jens Thiede: "Re: Problem in splitting a string"
- Maybe reply: Dave Brueck: "Re: Problem in splitting a string"
- Reply: Peter Otten: "Re: Problem in splitting a string"
- Reply: Jeff Shannon: "Re: Problem in splitting a string"
- Reply: Paul McGuire: "Re: Problem in splitting a string"
- Maybe reply: Terry Reedy: "Re: Problem in splitting a string"
- Reply: Byron: "Re: Problem in splitting a string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|