Splitting text from a database table

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default Splitting text from a database table

    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: [email]Colin.Walls@murorum.demon.co.uk[/email]
    Web: [url]http://www.murorum.demon.co.uk[/url]
    Phone: 01625 535123
    Mobile: 07765 175829
    Tux Guest

  2. Similar Questions and Discussions

    1. Problem with text splitting into separate pieces
      This seems to be related to opening older (v.9) Illustrator files using CS. When I open files containing text, I get the default message asking to...
    2. Import text file into database table
      I need to build a web page that allows the user to select a text file and click a button to import the file into a database table. Does anyone...
    3. [PHP] splitting content from database into pages again
      function page_content($content,$limit = 10,$page) { $limit=20; $afile = explode("\r\n", $content); $maxline = count($afile); // count...
    4. splitting content from database into pages again
      hi guys regarding my question yesterday here is exactly what i want to do http://www.evilwalrus.com/articles.php?aid=42 this is obvioiusly...
    5. Splitting a Database
      To All on Access Discussion Forum: I have already split my database. Now I just added a new table to the back-end, but it is not linked to the...
  3. #2

    Default Re: Splitting text from a database table

    In article <bdsj7n$jqp$1$8302bc10@news.demon.co.uk>,
    Tux <colin@murorum.demon.co.uk> 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139