2 ms·
> I’ve found a quick-and-dirty way of identifying the unwarranted self-confident types is to ask them how they’d quickly put together a CSV parser - if they giv
by thaumasiotes 7y ago
> I’ve found a quick-and-dirty way of identifying the unwarranted self-confident types is to ask them how they’d quickly put together a CSV parser - if they give an answer involving `String.Split` you can tell they don’t have a degree.
Hmmm. I have a degree in computer science, and I've written a parser. ( https://github.com/thaumasiotes/regexp https://github.com/thaumasiotes/regexp )
I'm pretty sure it would be faster to put together a CSV parser using String.Split than to write a streaming parser to handle the problem. You did specify that you want this done quickly, right?
My immediate thought would be to make sure commas that appear in field values don't cause spurious splitting. After that, yeah, String.Split.
Can you say more about why this means I don't have a degree?
- imtringued 7y agoCSV is far more complicated than just commas and newlines. There is string quotation and character escaping.