2 ms·
This is my take as well. Most of our CSV concerns center around generating them, not consuming them. Generating a valid CSV string that Excel wont complain abo
by bob1029 7y ago
This is my take as well. Most of our CSV concerns center around generating them, not consuming them.
Generating a valid CSV string that Excel wont complain about is approximately 2 lines of LINQ if you have a clean starting point (i.e. a list of class instances with strongly-typed members).
For cases where I have to read garbage CSV, I first go to the source and determine if we can't get a better export or interface into the data. Most shit CSV I see is a consequence of someone hacking together a SQL query to produce the output. I'd be inclined to just request a database export at that point. Obviously not always an option, but you should always insist on having the best representation of the business data before you start banging your head against the wall on parsing it.