tags:

views:

252

answers:

7

Hi

Our company has pretty much banned us from using open-source libraries in our commercial products due to licensing issues. We are currently looking for a commercial .NET library that can read and parse CSV files - does anyone have any ideas ?

As far as functionality goes, I really need to be able to read a CSV file into a strongly typed DataTable - with appropriate conversion and flagging of type conversion failures.

Thanks

Matt

+2  A: 

FileHelpers v 2.0

abmv
Thanks, but it's L-GPL, so I can't use it...
Matt
Still have licensing issues with that approach...
Matt
-1: "nobody has to know you ripped off the code from them hee.."
ParmesanCodice
Why use that one instead of .NET's built-in parser?
Jonathan Allen
+2  A: 

Sébastien Lorion's excellent CSV library is licensed under the MIT license, so you can do pretty much anything with it so long as you acknowledge the original copyright.

LukeH
How is that better than .NET's built-in parser?
Jonathan Allen
+2  A: 

CSVReader did the trick for us.

Matt
+3  A: 

I think it would be well worth studying what the differences are between different open source licenses, so that you can explain to whoever is 'banning' you from using them, what they all mean and what the implications are for your company.

For instance, I would never advocate using a GPL'ed library in one of our closed source programs, but an L-GPL'ed could be made to work. Other licenses are similarly less encumbered.

Also bear in mind that just because a library is published on the web as GPL, quite often, if you email the author(s), you may find that they have other licensing options. For instance I was interested in one GPL library, emailed the author and he said he would be happy to license for closed source projects for $100 per year for support and no runtime cost (that's $100 in total for anyone in our company to use the library on any number products we ship).

This is a damn sight better than $3000 for the development version and $500 per runtime for the commercial library I was also considering. Admittedly the commercial library did much more than the open source library, but we didn't need all that extra functionality at the time.

Mark Booth
+3  A: 

.NET has a built-in CSV parser. A real one that follows the RFC to the letter and provides error recovery when some lines are bad but the rest of the file can be parsed.

http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx

Jonathan Allen
Thanks - missed that. Is it VB only ? I know I can reference it from a c# project if needed...
Matt
It's .NET, you can use it from any language.
Jonathan Allen
I wish they did not call the library `Microsoft.VisualBasic` because there is no reason whatsoever that a C# app shouldn't use it (as in people in the past have frowned on referencing that library simply because they are coding a C# app - it's all .NET!)
Paul Kohler
A: 

Try CSV Helper. It has a Ms-PL license. If you can use Microsoft products, you should be able to use this also.

Josh Close
+1  A: 

How about using built in OleDb in .NET with Jet Engine. It handles different file delimiter type as well. See this article

http://www.codeproject.com/KB/cs/UsingJetForImport.aspx

Fadrian Sudaman
Aya, I was about to suggest it. There is one problem you should be aware of, there is no 64bit support, so you have to force compiling the product to 32bit (I just found out after installing a new 64bit workstation)
Pete