![]() |
VOOZH | about |
dotnet add package CSVFile --version 3.2.1
NuGet\Install-Package CSVFile -Version 3.2.1
<PackageReference Include="CSVFile" Version="3.2.1" />
<PackageVersion Include="CSVFile" Version="3.2.1" />Directory.Packages.props
<PackageReference Include="CSVFile" />Project file
paket add CSVFile --version 3.2.1
#r "nuget: CSVFile, 3.2.1"
#:package CSVFile@3.2.1
#addin nuget:?package=CSVFile&version=3.2.1Install as a Cake Addin
#tool nuget:?package=CSVFile&version=3.2.1Install as a Cake Tool
👁 NuGet
👁 GitHub Workflow Status
👁 SonarCloud Coverage
👁 SonarCloud Bugs
👁 SonarCloud Vulnerabilities
This library is a series of unit tested, thoroughly commented CSV parsing functions which I have developed off and on since 2006. Extremely small and easy to implement; includes unit tests for the majority of odd CSV edge cases. Library supports different delimiters, qualifiers, and embedded newlines. Can read and write from data tables.
A few reasons:
This library was designed to handle edge cases I experienced when working with partner files.
| Case | Example |
|---|---|
| CSV files larger than can fit into memory streamed off disk | 10TB files |
| Pipe delimited files | field1\|field2 |
| Hand written CSV with spaces after deliminters | "field1", "field2", "field3" |
| Embedded newlines within a text qualifier | "field1\r\nanother line","field2" |
| Text qualifiers as regular characters within a field | "field1",field2 "field2" field2,"field3" |
| Doubled up text qualifiers within a qualified field | "field1","field2 ""field2"" field2","field3" |
| Different line separators | CR, LF, something else |
| Different text encoding | UTF-8, UTF-16, ASCII |
| SEP= lines for European CSV files | sep=;\\r\\n |
Want to get started? Here are a few walkthroughs.
Do you have files that use the pipe symbol as a delimiter, or does your application need double quotes around all fields? No problem!
var settings = new CSVSettings()
{
FieldDelimiter = '|',
TextQualifier = '\'',
ForceQualifiers = true
};
s = array.ToCSVString(settings);
The latest asynchronous I/O frameworks allow you to stream CSV data off disk without blocking. Here's how to use the asynchronous I/O features of Dot Net 5.0:
using (var cr = CSVReader.FromFile(filename, settings)) {
await foreach (string[] line in cr) {
// Do whatever you want with this one line - the buffer will
// only hold a small amount of memory at once, so you can
// iterate at your own pace!
}
}
Don't worry if your project isn't yet able to use asynchronous foreach loops. You can still use the existing reader logic:
using (CSVReader cr = new CSVReader(sr, settings)) {
foreach (string[] line in cr) {
// Process this one line
}
}
You can serialize and deserialize between List<T> and CSV arrays. Serialization supports all basic value types, and it can even optionally support storing null values in CSV cells.
var list = new List<MyClass>();
// Serialize an array of objects to a CSV string
string csv = CSV.Serialize<MyClass>(list);
// Deserialize a CSV back into an array of objects
foreach (var myObject in CSV.Deserialize<MyClass>(csv)) {
// Use the objects
}
For those of you who work in older frameworks that still use DataTables, this feature is still available:
// This code assumes the file is on disk, and the first row of the file
// has the names of the columns on it
DataTable dt = CSV.LoadDataTable(myfilename);
// Save a datatable to a file
dt.SaveAsCSV(myfilename, true);
The class CSV contains a lot of useful functions for hand rolling your own CSV related code. You can use any of the functions in the CSV class directly.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net20 net20 is compatible. net35 net35 was computed. net40 net40 is compatible. net403 net403 was computed. net45 net45 is compatible. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 3 NuGet packages that depend on CSVFile:
| Package | Downloads |
|---|---|
|
LuminaSupplemental.Excel
Supplemental data for lumina and dalamud plugins. |
|
|
AllaganLib.GameSheets
Package Description |
|
|
AllaganLib.Data
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 3.2.1 | 70,748 | 10/10/2025 | |
| 3.2.0 | 131,380 | 8/6/2024 | |
| 3.1.4 | 1,335 | 8/5/2024 | 3.1.4 is deprecated because it has critical bugs. |
| 3.1.3 | 1,460 | 8/5/2024 | 3.1.3 is deprecated because it has critical bugs. |
| 3.1.2 | 41,923 | 7/19/2023 | 3.1.2 is deprecated because it has critical bugs. |
| 3.1.1 | 67,016 | 3/18/2023 | |
| 3.1.0 | 25,849 | 4/4/2022 | |
| 3.0.9 | 2,263 | 3/23/2022 | |
| 3.0.8 | 1,951 | 3/23/2022 | 3.0.8 is deprecated. |
| 3.0.7 | 11,660 | 3/16/2022 | |
| 3.0.6 | 38,618 | 3/7/2022 | |
| 3.0.5 | 1,716 | 3/2/2022 | |
| 3.0.4 | 2,188 | 2/15/2022 | |
| 3.0.3 | 1,773 | 2/11/2022 | |
| 3.0.2 | 13,652 | 4/9/2021 | |
| 3.0.1 | 1,706 | 4/9/2021 | |
| 2.0.3 | 57,969 | 10/30/2018 | |
| 1.2.2.2 | 36,082 | 11/18/2016 | |
| 1.2.2 | 2,980 | 11/4/2016 | |
| 1.2.2-beta | 1,670 | 11/4/2016 |
October 9, 2025
* Fix issue with loops during text qualifiers, reported by @AlainBartmanDilaw and @james-perfectserve, fix by james
* Update to Net80 for mainstream build, Net50 is no longer relevant