That may work with a small file, but these CSV files are pretty large
to load whole into a DataSet---some of them will take up over a
megabyte of memory. Since DataSets are connectionless, the ODBC
Driver would either have to either load the whole thing into memory,
which would violate constraint #3, or it would have to somehow copy
and cache the whole file, which would be pretty inefficient.
Also, it looks like you can't open the file without knowing what the
format is in advance, which limits its usefulness. Unless I'm missing
something, it requires a .ini file. Yuck!
And I'm guessing that if it comes from Microsoft, it's Microsoft-only,
and would violate constraint #1.
Thanks for the suggestion, though.
-Mike
On Tue, 11 May 2004 13:40:57 -0400, "Ben Dewey"
<be*******@scientiae.com> wrote:
You can load a csv in as an OLEDB Dataset see this link on for information
on the connection string and let me know if you have any more questions.
http://www.able-consulting.com/MDAC/...CDriverForText
"Mike Bridge" <mi**@bridgecanada.com> wrote in message
news:an********************************@4ax.com.. . Can anyone suggest a good CSV parser that I can use from C#?
I've been using the Ostermiller CSVParser in Java, which is great, but
I can't find a full-featured C# one yet....
I need one that:
- Works for Mac, Windows and Unix end-of-line characters
- Handles fields with end-of-line characters in the middle of it
- Doesn't read the entire file into memory (files can be 100000+
records)
- Runs as managed code
(It'd also be nice if it could read non-latin-1 character sets if
necessary.)
I've found a few freeware ones, but none satisfies all those
requirements. I haven't been able to find a commercial one.
Thanks!
-Mike