Did something similar years ago --- so...

#!\user\bin\perl -w while (@a_Field=GetCSV(@a_Field)) { print join(' | ',@a_Field)."\n\n"; }; sub GetCSV{ my($s_Line,$s_Text); while ($s_Line=<DATA>) { #print "'$s_Line'\n"; my(@a_Field); $s_Text.=$s_Line; while ($s_Text =~ m{([^",]*)([,\n])|"((?:[^"]|"")*)"([,\n])}gs) +{ unless (substr($`,-1,1) eq '"') { if (defined $1) { push(@a_Field,$1); if ($2 eq "\n") { return @a_Field; }; } else { my($s_Field); ($s_Field=$3)=~s/""/"/g; push(@a_Field,$s_Field); if ($4 eq "\n") { return @a_Field; }; }; }; }; }; return (); }; __DATA__ 10915,"S","Phil","ing Valley Middle School",$0.00,0,,0 10916,"Tr","Ny",,,,,,"999-999-9999",,,,"715000 works at Re-Max Wishing for housecoat with dogs, no luck",$0.00,0,,0 10917,"Ro","Ox","3677 As Dr","W","BC","V4T 2W5",,"1111111111",,,,,$0.0 +0,0,,0 10918,"Sa","Fri",,"K","BC",,,"2222222222",,,,,$0.00,0,,0 10355,"Val","Woj",,,,,,"3333333333",,,,"Solutions",$0.00,0,,0 10356,"Ter","Bes",,,,,,"1211211212",,,,,$0.00,0,,0 10357,"Phi","Har",,,,,,"1231231234",,,,"6 Woodcroft Ave St Catns x1x1x1 999-999-3203 check the address to see if it is still her's.",$0.00,0,,0 10358,"Ra","Gak",,"Kel",,,,"3453453456",,,,,$0.00,0,,0 10359,"J","Ru",,"V","BC",,,"7777777777",,,,"st ing to tell J to come a +gain… (555) 899-9999",$0.00,0,,0 10360,"Li","Sa",,"Win",,,,"4444444444",,,,"LDr Claremont",$0.00,0,,0 10361,"Ke","Ta",,"K","BC",,,"5555555555",,,,,$0.00,0,,0 10362,"Kat","son",,"V","BC",,,"6666666666",,,,,$0.00,0,,0

In reply to Re: Regex Split and Formatting by clueless newbie
in thread Regex Split and Formatting by reaper9187

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • 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;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.