![]() |
VOOZH | about |
dotnet add package PocketCsvReader --version 2.36.30
NuGet\Install-Package PocketCsvReader -Version 2.36.30
<PackageReference Include="PocketCsvReader" Version="2.36.30" />
<PackageVersion Include="PocketCsvReader" Version="2.36.30" />Directory.Packages.props
<PackageReference Include="PocketCsvReader" />Project file
paket add PocketCsvReader --version 2.36.30
#r "nuget: PocketCsvReader, 2.36.30"
#:package PocketCsvReader@2.36.30
#addin nuget:?package=PocketCsvReader&version=2.36.30Install as a Cake Addin
#tool nuget:?package=PocketCsvReader&version=2.36.30Install as a Cake Tool
PocketCsvReader is a highly efficient and lightweight library tailored for parsing delimited flat files like CSV and TSV. With a focus on simplicity and performance, it offers seamless file reading and supports versatile outputs, including DataTables, string arrays, strongly-typed object mapping and an IDataReader interface. Designed for projects requiring rapid data ingestion with minimal configuration, PocketCsvReader is a dependable solution for handling structured flat-file data effortlessly.
About | Install | Quick-start
Social media: 👁 website
👁 twitter badge
Releases: 👁 GitHub releases
👁 nuget
👁 GitHub Release Date
👁 licence badge
Dev. activity: 👁 GitHub last commit
👁 Still maintained
👁 GitHub commit activity
Continuous integration builds: 👁 Build status
👁 Tests
👁 CodeFactor
👁 codecov
👁 FOSSA Status
Status: 👁 stars badge
👁 Bugs badge
👁 Top language
Replace <VersionNumber> with the desired version in each of the following solutions. If no version is specified, the latest version will be installed.
Open a command prompt or terminal.
Run the following command:
nuget install PocketCsvReader -Version <VersionNumber>
Open the Package Manager Console from Tools > NuGet Package Manager > Package Manager Console.
Run the following command:
Install-Package PocketCsvReader -Version <VersionNumber>
Open a terminal or command prompt.
Navigate to the directory of your project.
Run the following command:
dotnet add package PocketCsvReader --version <VersionNumber>
The CsvReader class is a flexible and efficient tool for reading and parsing CSV files or streams into various formats, such as DataTable, IDataReader, or strongly-typed objects. This documentation explains the basics of how to use the class, including common use cases and examples.
DataTable.IDataReader.IEncodingDetector interface.You can create an instance of CsvReader with various configurations:
// Default configuration: comma-delimited, double quotes for escaping, 4 KB buffer size.
var csvReader = new CsvReader();
// Custom CSV profile (e.g., semicolon-delimited, double quotes for escaping).
var csvReaderWithProfile = new CsvReader(CsvProfile.SemiColumnDoubleQuote);
// Custom buffer size for large files.
var csvReaderWithBuffer = new CsvReader(bufferSize: 64 * 1024);
// Both custom profile and buffer size.
var csvReaderCustom = new CsvReader(CsvProfile.SemiColumnDoubleQuote, bufferSize: 16 * 1024);
DataTableThe ToDataTable method reads CSV data and returns a DataTable containing all rows and fields.
DataTable dataTable = csvReader.ToDataTable("example.csv");
or to read from a stream,
using var stream = new FileStream("example.csv", FileMode.Open, FileAccess.Read);
DataTable dataTable = csvReader.ToDataTable(stream);
IDataReaderThe ToDataReader method provides a forward-only, read-only CsvDataReader implementing IDataReader for processing large files efficiently.
using var stream = new FileStream("example.csv", FileMode.Open, FileAccess.Read);
using var reader = csvReader.ToDataReader(stream);
while (reader.Read())
{
Console.WriteLine(reader[0]); // Access the first column of the current row.
Console.WriteLine(reader.GetDateTime(1)); // Access the second column of the current row as an object boxing a DateTime.
Console.WriteLine(reader.GetFieldValue<DateOnly>(2); // Access the third column of the current row as DateOnly.
}
using var stream = new FileStream("example.csv", FileMode.Open, FileAccess.Read);
foreach (var record in csvReader.ToArrayString(stream))
{
Console.WriteLine(string.Join(", ", record));
}
The To<T> method maps CSV records to objects of a specified type.
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
}
using var stream = new FileStream("example.csv", FileMode.Open, FileAccess.Read);
IEnumerable<Person> people = csvReader.To<Person>(stream);
foreach (var person in people)
{
Console.WriteLine($"{person.FirstName} {person.LastName}, Age: {person.Age}");
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 is compatible. 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. |
Showing the top 4 NuGet packages that depend on PocketCsvReader:
| Package | Downloads |
|---|---|
|
NBi.Framework.Tools
This package contains the NBi framework and references each dll to your project. This package is not intended to be directly used by end-users willing to create test-suites. Check the package NBi.VisualStudio, if you want to facilitate the usage of NBi from Visual Studio. NBi is a testing framework (add-on to NUnit) for Business Intelligence and Data Quality. It supports the Microsoft Data platform (SQL Server Database engine, SSIS, SSAS, SSRS) but also MySQL, PostgreSQL and other NoSQL solutions. |
|
|
Didot.Core
Package Description |
|
|
Packata.ResourceReaders
Packata is a library for consuming Data Package v2 files. The `Packata.ResourceReaders` package specializes in providing read access to resource files using common patterns, such as `IDataReader`, ensuring seamless data retrieval and processing. |
|
|
PocketCsvReader.Ndjson
PocketCsvReader.Ndjson is a lightweight library that extends PocketCsvReader to parse NDJSON (Newline Delimited JSON) files. Its main function is to read each JSON object line by line and expose the data through an IDataReader, mapping JSON properties to fields based on the object structure and an optional schema. It is designed for high performance and simplicity when processing large streams of structured JSON data. |
Showing the top 1 popular GitHub repositories that depend on PocketCsvReader:
| Repository | Stars |
|---|---|
|
Seddryck/NBi
NBi is a testing framework (add-on to NUnit) for Business Intelligence and Data Access. The main goal of this framework is to let users create tests with a declarative approach based on an Xml syntax. By the means of NBi, you don't need to develop C# or Java code to specify your tests! Either, you don't need Visual Studio or Eclipse to compile your test suite. Just create an Xml file and let the framework interpret it and play your tests. The framework is designed as an add-on of NUnit but with the possibility to port it easily to other testing frameworks.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.36.30 | 106 | 6/15/2026 |
| 2.36.29 | 116 | 6/14/2026 |
| 2.36.28 | 111 | 6/12/2026 |
| 2.36.27 | 114 | 6/12/2026 |
| 2.36.22 | 473 | 5/13/2026 |
| 2.36.18 | 155 | 5/13/2026 |
| 2.36.17 | 982 | 12/14/2025 |
| 2.36.16 | 672 | 11/12/2025 |
| 2.36.15 | 642 | 11/11/2025 |
| 2.36.14 | 555 | 11/9/2025 |
| 2.36.12 | 633 | 10/9/2025 |
| 2.36.11 | 1,490 | 10/6/2025 |
| 2.36.10 | 1,725 | 8/20/2025 |
| 2.36.9 | 590 | 8/16/2025 |
| 2.36.7 | 4,705 | 6/10/2025 |
| 2.36.6 | 414 | 6/5/2025 |
| 2.36.5 | 325 | 6/3/2025 |
| 2.36.4 | 2,806 | 5/26/2025 |
| 2.36.3 | 324 | 5/23/2025 |
| 2.36.2 | 307 | 5/22/2025 |