Howdy all,
I need to read ascii files (comma separated) using C# .
Which libraries or namespaces should I be using to accomplish.
thanks
nath
Printable View
Howdy all,
I need to read ascii files (comma separated) using C# .
Which libraries or namespaces should I be using to accomplish.
thanks
nath
You can use ADO.NET to access CSV files in a folder as though they were tables in a database. As is always the case with ADO.NET, it is almost exactly the same as using any other data source. See www.connectionstrings.com for more details.
Alternatively you can use a StreamReader to read the file all at once or line by line. You can then use the String.Split method to separate a line into an array of strings with the delimiters removed. There are examples all over the forums, although the majority may be in VB.NET.