views:

64

answers:

3

Just looking for a component that can be programmatically called in a fairly simple way to import a flat file of data. The data is typically 100,000-500,000 rows, each row contains about 200 fields of text anywhere from about 5 to 250 characters long. Data could be CSV, tab-delimited, etc.

There is some budget for this, but would like to stay pretty cheap if possible.

+5  A: 

Try FileHelpers, which is open source.

I don't have any experience with it, though.

SLaks
+4  A: 

The .NET Framework is pretty good at reading flat text files, without any 3rd party components. TextFieldParser, for example, handles this incredibly well, and is part of the framework. (And yes, you can use it in C#, even though it's in the VB namespace...)

I recommend reading Deborah Kurata's articles on "Reading Comma Delimited Values" (plus part 2 using TextFieldParser) and "Reading Fixed Length Values". They cover this topic in detail.

Reed Copsey
+1 for the roll your own approach. There's a risk it would take as much time to find and operate a component as it would to do the same oneself. That said, FileHelpers looks kind of handy, but LGPL isn't entirely free of obligation.
spender
I'm more looking for a high-level component that wraps up all of this functionality into an easy to use method call like ImportFlatFileToSQLServer
alchemical
Perhaps you didn't ask the right question... it seems like you have a larger purpose in mind.
spender
@LuftMensch: Look at Deborah Kurata's articles I mentioned - one puts the flat file into a DataTable, which you could just then send to SQL Server in one shot. Pretty simple...
Reed Copsey
The whole reason behind the question is that its not easy to do in .Net...easy = not having to read articles etc. :)
alchemical
@LuftMensch: Heh, it's actually pretty damn easy, though. But if you don't want to learn how something works, feel free not to read the articles. Frankly, in this case, rolling your own solution is probably less work than the work involved in deployment and management of a 3rd party solution...
Reed Copsey
ok, if I have time to get more into the under the lower-level approach I will take a look at it, thanks for sharing the links.
alchemical
A: 

This code project seems to work great!

alchemical