James Edward Gray II wrote:

/ ...

>> A plain-text CSV file uses linefeeds as record delimiters. A
>> program that
>> uses "readline" or "gets" splits the records just as a sane CSV parser
>> would. And IMHO a CSV file should never, ever have linefeeds
>> embedded in
>> fields.
> 
> Your opinion doesn't make you right on this one.

I didn't make a statement of fact, so the term and concept of "right" is not
appropriate. I used the term "should". And I acknowledged that I was wrong
later in the same post.

/ ...

> I know you're a don't-use-a-library guy and you know I disagree.

First, that characterization ("don't-use-a-library guy") is false. Second,
this isn't about libraries versus hand-written code, it is about reliable,
robust file protocols. IMHO allowing linefeeds into CSV fields is plain
stupid, and this is not about right and wrong, it is about robustness.

In any case, the majority of the responders in this thread tried to use
simple linefeed parsing in their replies, as I did, with the same risk.

> This is the reason why.  The edge cases will get you every time.

The implication is that a failure to use a library will get you every time.
This violates common sense in the most fundamental way, for a reason you
should certainly be able to detect.

-- 
Paul Lutus
http://www.arachnoid.com