I downloaded your script and your first text sample, ran the script on that text, and did not see the problem that you showed in the second text sample -- instead, I got the output that you were hoping to get. Ditto when running the third text sample (output was as intended, without the truncation you showed in the fourth text sample).
So, if you're seeing those truncations, I would assume that you are not doing exactly the same thing I did -- either you are not running that exact script, or you are not using exactly those two inputs, or you are doing something else to the data in addition to running that script. Or else you are using something to view the output which is not giving you a faithful presentation of the data.
(Have you tried using other methods to view and compare the input and the output, e.g. unix tools like "wc" or "od" or "xxd"?)
As for CSV parsing modules not doing what you want, which particular modules have you tried, and how in particular did they fail to do the right thing for you? I would expect that Text:xSV would be pretty reliable for the kind of data you describe (handling embedded line-feeds within some fields), because that was a particular feature that the module author was intent on getting right.
(updated to include the link to cpan)
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.