![]() |
VOOZH | about |
dotnet add package OfficeIMO.CSV --version 0.1.46
NuGet\Install-Package OfficeIMO.CSV -Version 0.1.46
<PackageReference Include="OfficeIMO.CSV" Version="0.1.46" />
<PackageVersion Include="OfficeIMO.CSV" Version="0.1.46" />Directory.Packages.props
<PackageReference Include="OfficeIMO.CSV" />Project file
paket add OfficeIMO.CSV --version 0.1.46
#r "nuget: OfficeIMO.CSV, 0.1.46"
#:package OfficeIMO.CSV@0.1.46
#addin nuget:?package=OfficeIMO.CSV&version=0.1.46Install as a Cake Addin
#tool nuget:?package=OfficeIMO.CSV&version=0.1.46Install as a Cake Tool
👁 nuget version
👁 nuget downloads
OfficeIMO.CSV is a fluent, strongly typed CSV document model aligned with the OfficeIMO ecosystem. It supports in-memory transforms, streaming reads, schemas, validation, typed mapping, and AOT-friendly explicit selectors.
dotnet add package OfficeIMO.CSV
using OfficeIMO.CSV;
using System.Globalization;
new CsvDocument()
.WithDelimiter(';')
.WithCulture(CultureInfo.InvariantCulture)
.WithHeader("Name", "Age", "City")
.AddRow("Przemek", 36, "Mikolow")
.AddRow("Dominika", 30, "Mikolow")
.AddColumn("Bucket", row => row.AsInt32("Age") >= 35 ? "Senior" : "Regular")
.SortBy("Age")
.Filter(row => row.AsString("City") == "Mikolow")
.Save("people.csv", new CsvSaveOptions {
Delimiter = ';',
IncludeHeader = true,
NewLine = "\n"
});
AddRow, AddColumn, RemoveColumn, SortBy, Filter, and Transform.var document = CsvDocument.Load("input.csv")
.EnsureSchema(schema => schema
.Column("Id").AsInt32().Required()
.Column("Name").AsString().Required()
.Column("Age").AsInt32().Optional())
.ValidateOrThrow();
Collect validation errors without throwing when an import pipeline should report all bad rows:
var document = CsvDocument.Load("input.csv")
.EnsureSchema(schema => schema
.Column("Id").AsInt32().Required()
.Column("Name").AsString().Required()
.Column("Age").AsInt32().Optional()
.Column("Active").AsBoolean().WithDefault(true));
document.Validate(out var errors);
foreach (var error in errors) {
Console.WriteLine($"{error.RowIndex}:{error.ColumnName} - {error.Message}");
}
Mapping is explicit and delegate-based, so it stays predictable for trimming and NativeAOT-sensitive applications.
using OfficeIMO.CSV;
List<Person> people = CsvDocument.Load("people.csv")
.Map<Person>(map => map
.FromColumn<int>("Id", (person, value) => {
person.Id = value;
return person;
})
.FromColumn<string>("Name", (person, value) => {
person.Name = value;
return person;
})
.FromColumn<int>("Age", (person, value) => {
person.Age = value;
return person;
})
.FromColumn<string>("City", (person, value) => {
person.City = value;
return person;
}))
.ToList();
public sealed class Person {
public int Id { get; set; }
public string Name { get; set; } = "";
public int Age { get; set; }
public string City { get; set; } = "";
}
For immutable models, return a new instance from each assignment:
using OfficeIMO.CSV;
var people = CsvDocument.Load("people.csv")
.Map<PersonRecord>(map => map
.FromColumn<int>("Id", (person, value) => person with { Id = value })
.FromColumn<string>("Name", (person, value) => person with { Name = value }))
.ToList();
public sealed record PersonRecord {
public int Id { get; init; }
public string Name { get; init; } = "";
}
Use streaming mode when the caller only needs forward-only row processing.
foreach (var row in CsvDocument.Load("large.csv", new CsvLoadOptions {
Mode = CsvLoadMode.Stream,
HasHeaderRow = true,
TrimWhitespace = true
}).AsEnumerable()) {
int id = row.AsInt32("Id");
string? status = row.AsString("Status");
Console.WriteLine($"{id}: {status}");
}
Transforms such as SortBy, Filter, and AddColumn require in-memory mode. Materialize deliberately when that is the desired tradeoff:
var transformed = CsvDocument.Load("large.csv", new CsvLoadOptions {
Mode = CsvLoadMode.Stream
})
.Materialize()
.AddColumn("ImportedUtc", _ => DateTime.UtcNow)
.Filter(row => row.AsString("Status") == "Ready")
.SortBy(row => row.AsInt32("Id"));
transformed.Save("ready.csv");
FromObjects is useful for small exports from anonymous objects, DTOs, or dictionaries:
var rows = new[] {
new { Name = "Alpha", Count = 10, Active = true },
new { Name = "Beta", Count = 20, Active = false }
};
CsvDocument.FromObjects(rows)
.Save("summary.csv");
Parse text when a service receives CSV payloads without a temporary file:
string payload = "Name,Amount\nAlpha,10\nBeta,20";
var document = CsvDocument.Parse(payload)
.AddColumn("Currency", _ => "EUR");
string normalized = document.ToString(new CsvSaveOptions {
Delimiter = ',',
IncludeHeader = true
});
OfficeIMO.Reader.Csv.OfficeIMO.Excel.netstandard2.0, net8.0, net10.0, net472.| 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 is compatible. 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 | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 is compatible. 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 1 NuGet packages that depend on OfficeIMO.CSV:
| Package | Downloads |
|---|---|
|
OfficeIMO.Reader.Csv
CSV/TSV adapter extensions for OfficeIMO.Reader. |
Showing the top 1 popular GitHub repositories that depend on OfficeIMO.CSV:
| Repository | Stars |
|---|---|
|
EvotecIT/PSWriteOffice
PowerShell Module to create and edit Microsoft Word, Microsoft Excel, and Microsoft PowerPoint documents without having Microsoft Office installed.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.46 | 87 | 6/16/2026 |
| 0.1.45 | 199 | 6/16/2026 |
| 0.1.44 | 198 | 6/15/2026 |
| 0.1.43 | 233 | 6/13/2026 |
| 0.1.42 | 257 | 6/12/2026 |
| 0.1.41 | 190 | 6/9/2026 |
| 0.1.40 | 197 | 6/5/2026 |
| 0.1.39 | 350 | 5/27/2026 |
| 0.1.38 | 259 | 5/26/2026 |
| 0.1.37 | 191 | 5/26/2026 |
| 0.1.36 | 203 | 5/23/2026 |
| 0.1.35 | 215 | 5/22/2026 |
| 0.1.34 | 181 | 5/21/2026 |
| 0.1.33 | 187 | 5/21/2026 |
| 0.1.32 | 183 | 5/20/2026 |
| 0.1.31 | 201 | 5/19/2026 |
| 0.1.30 | 186 | 5/18/2026 |
| 0.1.29 | 394 | 5/16/2026 |
| 0.1.28 | 180 | 5/14/2026 |
| 0.1.27 | 384 | 5/14/2026 |