Ninjasoft.Csv 3.0.0

dotnet add package Ninjasoft.Csv --version 3.0.0
                    
NuGet\Install-Package Ninjasoft.Csv -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ninjasoft.Csv" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ninjasoft.Csv" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Ninjasoft.Csv" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ninjasoft.Csv --version 3.0.0
                    
#r "nuget: Ninjasoft.Csv, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ninjasoft.Csv@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ninjasoft.Csv&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Ninjasoft.Csv&version=3.0.0
                    
Install as a Cake Tool

Ninjasoft.Csv

Reading

Example data class. Note the columns are zero based.

using Ninjasoft.Csv;

public class Item
{
    [Column(2)]
    public string Description {get;set;}
    [Column(0)]
    public int Id {get;set;}
    [Column(1)]
    public string Name {get;set;}    
}

Example 1

string filePath = "/data/items.csv";
foreach(Item item in CsvReader.Read<Item>(filePath))
{
    //... do stuff
}

Example 2

string filePath = "/data/items.csv";
CsvReaderOptions options = new() {RowsToSkip = 1};
foreach(Item item in CsvReader.Read<Item>(filePath, options))
{
    //... do stuff
}

Options

RowsToSkip - Default is 0; How many rows should be skipped at the beginning. You may want to do this if you have a header row Delimiter - Default is ",". Currently there is only support for a single charater. We hope to support strings in future versions ContainsQuotes - Default is false. Enable this if your file uses quotes to denote strings. ie. 1,"Something","Another thing" TreatQuotedNullAsNull - Default is false. Enable this if your file has the string null and you want to treat it as a null value when parsing.

Writing

Not supported in this version

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 41 6/8/2026
2.0.0 341 11/26/2023
1.0.0 404 10/6/2023

CsvReader is now static. Updated to read and parse faster.