G
Guest
I need to parse an third party supplied delimited or fixed width text file
into a datatable. The delimiter may vary.
I am currently using a SteamReader to read each line and, for delimited
files, String.Split() to break each line into an array based on the
delimiter. The problem, as you may guess, is that the delimiter character is
being used in the data
i.e. "Kevin","Williams,"I like commas, I really do"
In the above I get an array with 4 elements and not 3 when the delimiter is
a comma.
My next stop is the Jet OLEDB provider, which expects CSV by default and
which I understand will handle other delimiters with a Schema.ini file.
Seems easy enough...
QUESTION:
Is there a better way than Jet or some .Net class that I am overlooking?
into a datatable. The delimiter may vary.
I am currently using a SteamReader to read each line and, for delimited
files, String.Split() to break each line into an array based on the
delimiter. The problem, as you may guess, is that the delimiter character is
being used in the data
i.e. "Kevin","Williams,"I like commas, I really do"
In the above I get an array with 4 elements and not 3 when the delimiter is
a comma.
My next stop is the Jet OLEDB provider, which expects CSV by default and
which I understand will handle other delimiters with a Schema.ini file.
Seems easy enough...
QUESTION:
Is there a better way than Jet or some .Net class that I am overlooking?