Sylvan.Data.Csv
1.2.6-b0003
Prefix Reserved
See the version list below for details.
dotnet add package Sylvan.Data.Csv --version 1.2.6-b0003
NuGet\Install-Package Sylvan.Data.Csv -Version 1.2.6-b0003
<PackageReference Include="Sylvan.Data.Csv" Version="1.2.6-b0003" />
paket add Sylvan.Data.Csv --version 1.2.6-b0003
#r "nuget: Sylvan.Data.Csv, 1.2.6-b0003"
// Install Sylvan.Data.Csv as a Cake Addin #addin nuget:?package=Sylvan.Data.Csv&version=1.2.6-b0003&prerelease // Install Sylvan.Data.Csv as a Cake Tool #tool nuget:?package=Sylvan.Data.Csv&version=1.2.6-b0003&prerelease
Sylvan.Data.Csv
A cross-platform .NET library for reading and writing CSV data files.
The CsvDataReader
provides readonly, row by row, forward-only access to the data.
Exposes a familiar API via DbDataReader
, which is ideal for accessing rectangular, tabular data sets.
Sylvan.Data.Csv is currently the fastest library for reading CSV data
in the .NET ecosystem.
Features
- Auto detect delimiters.
- Supports asynchronous IO.
- Strongly-typed accessors that avoid allocations.
- Supported types includes all standard .NET primitive types,
DateOnly
andTimeOnly
on .NET 6, - Binary data encoded with either base64 or hexadecimal.
- Supported types includes all standard .NET primitive types,
- Schema information to support database bulk-load operations.
Usage Examples
Basic
using Sylvan.Data.Csv;
// CsvDataReader derives from System.Data.DbDataReader
using CsvDataReader dr = CsvDataReader.Create("data.csv");
// iterate over the rows in the file.
while(dr.Read())
{
// iterate fields in row.
for(int i = 0; i < dr.FieldCount; i++)
{
var value = dr.GetString(i);
}
// Can use other strongly-typed accessors
// bool flag = edr.GetBoolean(0);
// DateTime date = edr.GetDateTime(1);
// decimal amt = edr.GetDecimal(2);
}
Bind CSV data to objects using Sylvan.Data.
using Sylvan.Data;
using Sylvan.Data.Csv;
using System.Linq;
using var dr = CsvDataReader.Create("data.csv");
IEnumerable<Record> records = dr.GetRecords<Record>();
Record[] allRecords = records.ToArray();
class Record {
public int Id { get; set; }
public string Name { get; set; }
public DateTime Date { get; set; }
public decimal Amount { get; set; }
}
Convert Excel data to CSV using Sylvan.Data and Sylvan.Data.Excel
using Sylvan.Data;
using Sylvan.Data.Csv;
using Sylvan.Data.Excel;
using System.Data.Common;
// create reader for excel data file
ExcelDataReader edr = ExcelDataReader.Create("example.xlsx");
// (optional) create data reader which allows variable-length rows
DbDataReader reader = edr.AsVariableField(edr => edr.RowFieldCount);
// create CSV writer to standard out
var csvWriter = CsvDataWriter.Create(Console.Out);
// write excel data as csv
csvWriter.Write(reader);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 is compatible. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.0
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Sylvan.Data.Csv:
Package | Downloads |
---|---|
cai.reporting
Provides helpers to generate report using FastReport |
|
Purcell
一个超高性能的Excel强类型读写映射库。(支持.xls .xlsx .csv) |
|
Sylvan.AspNetCore.Mvc.Csv
Package Description |
|
EgsLib
.Net library for interacting with Empyrion Galactic Survival |
|
AEMO.MDFF
Parser for Australian Energy Market Operator (AEMO) Meter Data File Format (MDFF) specification |
GitHub repositories (4)
Showing the top 4 popular GitHub repositories that depend on Sylvan.Data.Csv:
Repository | Stars |
---|---|
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
|
|
nietras/Sep
World's Fastest .NET CSV Parser. Modern, minimal, fast, zero allocation, reading and writing of separated values (`csv`, `tsv` etc.). Cross-platform, trimmable and AOT/NativeAOT compatible.
|
|
JasonBock/Rocks
A mocking library based on the Compiler APIs (Roslyn + Mocks)
|
|
MarkPflug/Sylvan.Data.Excel
The fastest .NET library for reading Excel data files.
|
Version | Downloads | Last updated | |
---|---|---|---|
1.3.9 | 93,987 | 7/2/2024 | |
1.3.8 | 64,470 | 4/23/2024 | |
1.3.7 | 90,071 | 2/10/2024 | |
1.3.6 | 1,729 | 2/6/2024 | |
1.3.6-b0001 | 82 | 2/5/2024 | |
1.3.5 | 101,740 | 11/3/2023 | |
1.3.4 | 1,003 | 11/2/2023 | |
1.3.3 | 121,622 | 7/17/2023 | |
1.3.2 | 42,073 | 6/6/2023 | |
1.3.2-b0001 | 151 | 5/30/2023 | |
1.3.1 | 13,638 | 5/7/2023 | |
1.3.0 | 23,519 | 4/25/2023 | |
1.2.7 | 106,405 | 2/15/2023 | |
1.2.6 | 838 | 2/13/2023 | |
1.2.6-b0003 | 296 | 2/10/2023 | |
1.2.6-b0002 | 217 | 2/8/2023 | |
1.2.6-b0001 | 144 | 2/7/2023 | |
1.2.5 | 7,997 | 1/16/2023 | |
1.2.4 | 187,032 | 10/25/2022 | |
1.2.3 | 899 | 10/21/2022 | |
1.2.2 | 35,183 | 9/12/2022 | |
1.2.1 | 874 | 9/8/2022 | |
1.2.0 | 17,178 | 8/28/2022 | |
1.1.16 | 215,024 | 6/14/2022 | |
1.1.15 | 1,220 | 6/2/2022 | |
1.1.14 | 911 | 6/1/2022 | |
1.1.13 | 126,244 | 3/31/2022 | |
1.1.12 | 35,826 | 2/18/2022 | |
1.1.11 | 23,417 | 1/5/2022 | |
1.1.10 | 4,660 | 12/9/2021 | |
1.1.9 | 12,961 | 10/23/2021 | |
1.1.8 | 20,123 | 9/8/2021 | |
1.1.7 | 2,964 | 8/14/2021 | |
1.1.6 | 716 | 8/13/2021 | |
1.1.5 | 783 | 8/8/2021 | |
1.1.4 | 953 | 8/5/2021 | |
1.1.3 | 3,526 | 7/23/2021 | |
1.1.2 | 763 | 7/19/2021 | |
1.1.1 | 835 | 7/15/2021 | |
1.1.0 | 812 | 7/14/2021 | |
1.0.3 | 2,399 | 5/21/2021 | |
1.0.2 | 751 | 5/15/2021 | |
1.0.1 | 1,569 | 5/4/2021 | |
1.0.0 | 911 | 4/5/2021 | |
0.10.1 | 767 | 3/27/2021 | |
0.10.0 | 1,022 | 3/15/2021 | |
0.9.2 | 896 | 1/31/2021 | |
0.9.1 | 764 | 1/25/2021 | |
0.9.0 | 957 | 1/9/2021 | |
0.8.3 | 719 | 1/6/2021 | |
0.8.2 | 783 | 1/4/2021 | |
0.8.1 | 725 | 1/3/2021 | |
0.8.0 | 872 | 11/30/2020 | |
0.7.4 | 793 | 9/28/2020 | |
0.7.2 | 4,200 | 9/11/2020 | |
0.7.0 | 867 | 9/10/2020 | |
0.6.3 | 858 | 8/10/2020 | |
0.6.2 | 864 | 8/7/2020 | |
0.6.1 | 814 | 8/4/2020 | |
0.6.0 | 865 | 8/3/2020 | |
0.5.0 | 885 | 6/30/2020 | |
0.4.5 | 866 | 6/25/2020 | |
0.4.4 | 855 | 6/25/2020 | |
0.4.3 | 1,105 | 6/10/2020 | |
0.4.2 | 984 | 5/29/2020 | |
0.4.1 | 849 | 5/2/2020 | |
0.4.0 | 880 | 4/29/2020 | |
0.3.4 | 918 | 4/21/2020 | |
0.3.3 | 880 | 4/16/2020 | |
0.3.2 | 785 | 4/15/2020 | |
0.3.1 | 836 | 4/13/2020 | |
0.3.0 | 829 | 4/10/2020 | |
0.2.1 | 957 | 4/7/2020 | |
0.2.0 | 821 | 4/7/2020 | |
0.1.2 | 859 | 4/7/2020 | |
0.1.1 | 821 | 4/6/2020 | |
0.1.0 | 2,468 | 4/4/2020 |