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. Advertisements

  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. Advertisements

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. David Williams
    Replies:
    2
    Views:
    1,367
    Jacob Yang [MSFT]
    Aug 12, 2003
  2. darrel
    Replies:
    3
    Views:
    354
    Bruno Sirianni
    May 1, 2004
  3. Rio
    Replies:
    4
    Views:
    1,459
  4. Peter Machell

    Splitting lines from a database query

    Peter Machell, Dec 26, 2006, in forum: Python
    Replies:
    6
    Views:
    620
    John Machin
    Dec 26, 2006
  5. sdf
    Replies:
    3
    Views:
    2,441
  6. chris f

    Splitting multiple cells in a Table

    chris f, Jun 3, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    356
    chris f
    Jun 3, 2008
  7. raj
    Replies:
    0
    Views:
    425
  8. Mothra
    Replies:
    10
    Views:
    663
    Anno Siegel
    Mar 11, 2005
Loading...