views:

101

answers:

4

Has anyone run across a quality library that will parse, line by line, CSV, tab-delimited, and Excel files?

I've started to do it manually but have noticed some of the intricacies in parsing a comma-delimited file. Such as situations where a cell has a comma in it as part of the data (blah,\"LastName, Jr.\",blah,blah).

+3  A: 

Take a look at the FileHelpers Library. It's free and has a number of examples on their page.

Ahmad Mageed
+1 I've used FileHelpers and was happy with the results.
Charles
Does FileHelpers require the input to have the structure of the file being known beforehand? I ask because of the classes being created in the examples. In my case, I can take an upload with 10 columns in one run, then later an upload with 15 columns. It varies like that, unfortunately.
Chris Stewart
A: 

You may take a look at FileHelpers.

Darin Dimitrov
A: 

Try http://filehelpers.sourceforge.net/

It will allow you to parse any type of file. All you have to do is create a mapping describing the file. Plus its free!

icemanind
+3  A: 

For CSV : http://www.codeproject.com/KB/database/CsvReader.aspx

Mathieu
Thanks! This works for the CSV scenarios.
Chris Stewart