Splitting text from a database table

Discussion in 'Perl Misc' started by Tux, Jul 1, 2003.

  1. Tux

    Tux Guest

    I have some text which I have extracted from a database table, this contains
    embedded CR/LF pairs, i.e. \r\n.

    I would like to split the text into separate strings, breaking at the CR/LF
    pair, but I just cannot work out how to do it. Would anybody take pity on a
    newbie and give me a clue.

    --
    Colin Walls
    Email:
    Web: http://www.murorum.demon.co.uk
    Phone: 01625 535123
    Mobile: 07765 175829
     
    Tux, Jul 1, 2003
    #1
    1. Advertising

  2. Tux

    Greg Bacon Guest

    In article <bdsj7n$jqp$1$>,
    Tux <> wrote:

    : I have some text which I have extracted from a database table, this
    : contains embedded CR/LF pairs, i.e. \r\n.
    :
    : I would like to split the text into separate strings, breaking at the
    : CR/LF pair, but I just cannot work out how to do it. Would anybody
    : take pity on a newbie and give me a clue.

    What have you tried? Why not something such as the following?

    @lines = split /\r\n/, $chunk;

    Hope this helps,
    Greg
    --
    When Galileo turned his telescope toward the heavens, and allowed Kepler to
    look as well, they found no enchantment or authorization in the stars, only
    geometric patterns and equations. God, it seemed, was less of a moral
    philosopher than a master mathematician. -- Neil Postman
     
    Greg Bacon, Jul 1, 2003
    #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. darrel
    Replies:
    3
    Views:
    312
    Bruno Sirianni
    May 1, 2004
  2. John Ericson
    Replies:
    0
    Views:
    450
    John Ericson
    Jul 19, 2003
  3. Mark
    Replies:
    0
    Views:
    462
  4. John Dibling
    Replies:
    0
    Views:
    435
    John Dibling
    Jul 19, 2003
  5. Peter Machell

    Splitting lines from a database query

    Peter Machell, Dec 26, 2006, in forum: Python
    Replies:
    6
    Views:
    525
    John Machin
    Dec 26, 2006
Loading...

Share This Page