3 ms·
Agreed. I think this thread can be summarized simply as: "In theory, theory and practice are the same. In practice, they're completely different." In theory,
by burntsushi 9y ago
Agreed.
I think this thread can be summarized simply as: "In theory, theory and practice are the same. In practice, they're completely different."
In theory, adhering to the CSV specification strictly is the Right Thing to Do. It's simple and makes it easy to confirm that the data you're parsing is correct.
But in practice, that all goes out the window. There are few things worse than running your CSV data through the standard parser and discovering that a smattering of fields contain stray quotes. And what do you get for that? The entire parser falls over and you can't do anything until you go in and fix the data. Or, if we're to believe other users in this thread, until someone goes and writes a specialty parser just for this task to fix the data.
In practice, CSV data is messy and therefore a strictly conforming parser tends to be incredibly annoying to use. IMHO, the authors of RFC 4180 failed to recognize this. As a result, most people just ignore it.