Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
If these conditions are met:
  1. There are always 5 Fields
  2. Additional commas only appear in the fifth field
  3. then this code will give you the desired result:
    while ($line=<DATA>) { chomp $line; ($char, $num1, $num2, $num3, $commafield)=split(/,/,$line,5); print <<MYDATA; $char $num1 $num2 $num3 $commafield ------- MYDATA } __DATA__ R,2164,27-2164,270102,Add Terminal Server to John, Jane, and Georges $,1111,22-2222,333333,Ignore mails from support, microsoft or bill

    In reply to Re: How can I read a file that is comma delimited but includes a comma in the string? by Skeeve
    in thread How can I read a file that is comma delimited but includes a comma in the string? by Anonymous Monk

    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post; it's "PerlMonks-approved HTML":

  4. Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  5. Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  6. Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  7. Please read these before you post! —
  8. Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  9. You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  10. Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  11. See Writeup Formatting Tips and other pages linked from there for more info.
Log In?

What's my password?
Create A New User
[erix]: ok, ok. happy pipe-dreams :P
[shmem]: have a good time inside your information bubble.
[erix]: perhaps we can have common hindsight at these thing in a few years time
[Your Mother]: Please don't fight, mom and dad!

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2018-03-19 21:19 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.