KBCsv is an efficient, easy to use .NET parsing and writing library for the CSV (comma-separated values) format.
C# Visual Basic Other
Switch branches/tags
Clone or download
kentcb Fix and add NCrunch configuration
I have exempted performance tests from execution for now. They are too
expensive to execute automatically. Besides, I have intentions to migrate to
BenchmarkDotNet at some point.
Latest commit facc9d6 Aug 20, 2017
Permalink
Failed to load latest commit information.
.nuget Migrate to new csproj Apr 19, 2017
Art Fix icon size. Feb 2, 2016
Doc Add ToEnumerable extension. Jan 30, 2016
Src Fix and add NCrunch configuration Aug 20, 2017
.gitignore Fix and add NCrunch configuration Aug 20, 2017
LICENSE netstandard support. Aug 16, 2016
README.md Add AppVeyor badge. Aug 18, 2016
appveyor.yml ho hum Dec 10, 2016
build.bat Bump version. Jan 30, 2016
build.fsx Fix build script Apr 19, 2017

README.md

Logo

KBCsv

Build status

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?

The easiest way to get KBCsv is to install via NuGet:

Install-Package KBCsv

Or, if you want the extensions:

Install-Package KBCsv.Extensions

Data-specific extensions are available as a separate package for .NET 4.5 (the other packages above are portable):

Install-Package KBCsv.Extensions.Data

How?

using (var streamReader = new StreamReader("data.csv"))
using (var csvReader = new CsvReader(streamReader))
{
    csvReader.ReadHeaderRecord();

    while (csvReader.HasMoreRecords)
    {
        var record = csvReader.ReadDataRecord();
        var name = record["Name"];
        var age = record["Age"];
    }
}

Please see the documentation for more details.

Who?

KBCsv is created and maintained by Kent Boogaart. Issues and pull requests are welcome.

Primary Features

  • Very easy to use
  • Very efficient
  • Separate extension libraries to provide additional (but optional) features such as working with System.Data types
  • Portable Class Library targetting netstandard 1.0
  • Full async support
  • Includes extensive documentation and examples in both C# and VB.NET
  • Conforms to the official CSV standard, RFC4180
  • Also conforms to pseudo-standards, such as this
  • Highly customizable, such as specifying non-standard value separators and delimiters
  • Very high test coverage