Split string first data have ",

Discussion in 'Python' started by moonhkt, Jan 29, 2013.

  1. moonhkt

    moonhkt Guest

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

    "abc.p,zip.p",a,b
    >>>
    moonhkt, Jan 29, 2013
    #1
    1. Advertising

  2. moonhkt

    Nick Cash Guest

    > >>> 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
    Nick Cash, Jan 29, 2013
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hanif
    Replies:
    6
    Views:
    17,697
    Paul Lutus
    Oct 17, 2003
  2. Carlos Ribeiro
    Replies:
    11
    Views:
    688
    Alex Martelli
    Sep 17, 2004
  3. Sam Kong
    Replies:
    5
    Views:
    228
    Rick DeNatale
    Aug 12, 2006
  4. Stanley Xu
    Replies:
    2
    Views:
    591
    Stanley Xu
    Mar 23, 2011
  5. moonhkt

    Split string data have ","

    moonhkt, Jan 29, 2013, in forum: Python
    Replies:
    3
    Views:
    101
    moonhkt
    Jan 30, 2013
Loading...

Share This Page