What?

KBCsv is an efficient, easy to use .NET parsing and writing library for the CSV (comma-separated values) format.

Why?

CSV is a common data format that developers need to work with, and .NET does not include intrinsic support for it. Implementing an efficient, standards-compliant CSV parser is not a trivial task, so using KBCsv avoids the need for developers to do so.

Where?

Documentation, binaries, and source for KBCsv can be downloaded from the releases section. KBCsv is also available via NuGet as a Portable Class Library:

KBCsv on NuGet

Or, if you want general extensions (also a PCL):

KBCsv Extensions on NuGet

Data-specific extensions are available as a separate package for .NET 4.5:

KBCsv Data Extensions on NuGet

How?

using (var reader = new CsvReader("data.csv"))
{
    reader.ReadHeaderRecord();

    while (reader.HasMoreRecords)
    {
        var record = reader.ReadDataRecord();
        var name = record["Name"];
        var age = record["Age"];
    }
}
Please download the documentation and source for more examples in both C# and VB.NET.

Who?

KBCsv is currently developed solely by Kent Boogaart.

I wrote KBCsv a number of years ago when I was working with massive (> 4GB) CSV data files. Existing CSV libraries were either not fast enough, clumsy to use, or both.

Primary Features

  • Very easy to use
  • Very efficient
  • A separate extensions library to provide useful additions to KBCsv such as working with System.Data types
  • Portable Class Library that targets .NET 4.5, Windows 8, and Windows Phone 8 (version 2.0.2 can be used still if you require support for .NET 3.5 and 4.0, Silverlight 4.0 and 5.0)
  • Full async support
  • Includes extensive documentation and examples in both C# and VB.NET
  • Conforms to available standards as found here and here
  • Highly customizable, such as specifying non-standard value separators and delimiters
  • Very high test coverage

Last edited Aug 14, 2013 at 2:11 AM by kentcb, version 17