Zonkey.Text 7.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Zonkey.Text --version 7.0.1
                    
NuGet\Install-Package Zonkey.Text -Version 7.0.1
                    
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="Zonkey.Text" Version="7.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zonkey.Text" Version="7.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Zonkey.Text" />
                    
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 Zonkey.Text --version 7.0.1
                    
#r "nuget: Zonkey.Text, 7.0.1"
                    
#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 Zonkey.Text@7.0.1
                    
#: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=Zonkey.Text&version=7.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Zonkey.Text&version=7.0.1
                    
Install as a Cake Tool

Zonkey.Text

A companion library for mapping CSV and fixed-width text files to C# objects using attribute-based configuration. Follows the same philosophy as Zonkey.Data but for flat files instead of databases.

Installation

dotnet add package Zonkey.Text

What's Inside

  • TextClassReader<T> -- reads text files into strongly-typed objects
  • TextClassWriter<T> -- writes objects to text files
  • CsvReader -- low-level CSV parser implementing IDataReader
  • DynamicCsvReader -- reads CSV into dynamic objects (no class definition needed)
  • TextRecordAttribute -- class-level config (delimiter, record type, text qualifier)
  • TextFieldAttribute -- property-level config (position, length, format)

Quick Example

using Zonkey.Text;

[TextRecord(TextRecordType.Delimited, Delimiter = ',', TextQualifier = '"')]
public class ProductImport
{
    [TextField(Position = 0)]
    public string Name { get; set; } = "";

    [TextField(Position = 1)]
    public decimal Price { get; set; }

    [TextField(Position = 2)]
    public string Category { get; set; } = "";
}
using var reader = new TextClassReader<ProductImport>("products.csv");
var products = new List<ProductImport>();
reader.Fill(products);

Supported Formats

  • Delimited (CSV, TSV, pipe-delimited, etc.) -- configurable delimiter and text qualifier
  • Fixed-width -- fields defined by position and length

Target Frameworks

  • .NET Standard 2.0 (works on .NET 6/8/10 and later)
  • .NET Framework 4.8

Documentation

See the text file mapping guide for detailed usage and the full documentation.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 2.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
7.0.3 88 8/13/2026
7.0.1 258 8/6/2026
7.0.0 108 7/30/2026
6.0.0.1600 29,622 8/14/2022
5.0.0 19,670 7/29/2018

Zonkey 7.0.1 adds symmetric DateOnly/TimeOnly conversions: providers that surface date/time columns as DateOnly/TimeOnly (notably Npgsql 10) now fill DateTime, TimeSpan, and string properties correctly on both materialization paths, DateOnly/TimeOnly property values round-trip to all supported databases, date/time-ish values destined for string properties render as round-trip ISO strings instead of culture-specific text, and TimeSpan properties now fill from string (standard "d.hh:mm:ss" TimeSpan.Parse forms, e.g. text-backed SQLite time columns) and DateTime (time-of-day) sources.

7.0.1 also reworks IN-list translation: a single value now renders as "col = @p0" rather than "col IN (@p0)"; PostgreSQL binds a list of two or more as one array parameter ("col = ANY($0)") at any size, removing the parameter-count ceiling there; a null in the list never matches, following SQL IN semantics rather than C# Contains semantics; and an empty or all-null list renders a commented "1 = 0". SplitList() is obsolete on .NET 6 and later in favour of System.Linq's Chunk(), and remains supported on .NET Framework 4.8, which has no Chunk. See the "Translation policy" section of docs/querying.md.

Zonkey 7.0 is a major release with breaking changes. Packages now target .NET 8, .NET 10, and .NET Framework 4.8 (Zonkey.Text targets .NET Standard 2.0 and .NET Framework 4.8), and assemblies are no longer strong-name signed. Applications on .NET 7 or earlier (including .NET 5/6 and .NET Core), on .NET Framework before 4.8, or requiring strong-named assemblies should stay on the latest v6.x release. See https://github.com/kellybirr/zonkey for full documentation, and see the repository README's "Breaking Changes from v6.x" section for the complete list of API changes (such as WithTransaction) and WHERE-expression behavior changes. FillRange paging on SQL Server now uses OFFSET/FETCH and requires SQL Server 2012 or later.