in reply to newline substitution is removing text too

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)

  • Comment on Re: newline substitution is removing text too

Replies are listed 'Best First'.
Re^2: newline substitution is removing text too
by Groxx (Novice) on Jan 21, 2007 at 17:34 UTC
    I don't remember the modules off-hand, but that wasn't one of them. I'll consider trying that one as well, thanks!

    As to the problem, I made it print to a file (previously just to the terminal window), and it worked fine.

    So... know anything about how OSX's bash terminal handles large lines of text, and why it might be cutting that out?

      I was actually using macosx/Terminal myself when trying your sample code, and it looked okay to me. I suppose sometimes if you are using the "more" or "less" pager and resizing the window, things can end up getting a little messy, but there's nothing in the example per se that would cause Terminal to drop or hide characters.
        "more" or "less" pager? Sorry, I don't know what that is...