CsvHelper.Fluent 0.1.4

CsvHelper Extensions to quickly read and write Excel-Compatible csv Files

Install-Package CsvHelper.Fluent -Version 0.1.4
dotnet add package CsvHelper.Fluent --version 0.1.4
<PackageReference Include="CsvHelper.Fluent" Version="0.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CsvHelper.Fluent --version 0.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
// read only needed columns
var file = new FileInfo("data.csv");
var csv = file.ReadCsv(row => new {
    col0 = row.GetField<int>(0),
    col2 = row.GetField<int>("col2"),
    col5 = int.Parse(row[5]),
});
// write collection with spesific culture
var file = new FileInfo("products.csv");
var config = Configuration.For(new CultureInfo("de-AT")); // optional, default == CurrentCulture

var products = new List<Product> {
    new Product {Name = "X223-A", Price = 3.90M},
    new Product {Name = "X223-B", Price = 4.95M},
    new Product {Name = "X223-Ö", Price = 8.85M},
};

products.WriteCsv(file, config);
// read only needed columns
var file = new FileInfo("data.csv");
var csv = file.ReadCsv(row => new {
    col0 = row.GetField<int>(0),
    col2 = row.GetField<int>("col2"),
    col5 = int.Parse(row[5]),
});
// write collection with spesific culture
var file = new FileInfo("products.csv");
var config = Configuration.For(new CultureInfo("de-AT")); // optional, default == CurrentCulture

var products = new List<Product> {
    new Product {Name = "X223-A", Price = 3.90M},
    new Product {Name = "X223-B", Price = 4.95M},
    new Product {Name = "X223-Ö", Price = 8.85M},
};

products.WriteCsv(file, config);

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.1.4 13,472 3/18/2018
0.1.3-g2d805d127c 284 3/18/2018