Sep

From managedcode/dotnet-skills · View interactive version

Sep is an AI agent skill from the GitHub repository managedcode/dotnet-skills. Use Sep for high-performance separated-value parsing and writing in .NET, including delimiter inference, explicit parser/writer options, and low-allocation row/column workflows. USE FOR: delimited data needs are performance-sensitive and allocation-aware; project needs explicit control over separato

How to use this skill

Skill file

Sep for .NET separated values

Trigger On

Install

Workflow

flowchart LR
  A[Input source: file/text/stream] --> B[Sep.Reader or Sep.New(...).Reader]
  B --> C[SepReaderOptions]
  C --> D[Rows -> Cols -> Span/Parse]
  D --> E[Transform and validate]
  E --> F[SepWriter via SepWriterOptions]
  F --> G[To file/text output]
  1. Decide schema shape
  1. Build reader with Sep.Reader(...) and explicit options only where needed:
  1. Read rows and map columns as ReadOnlySpan<char> first, convert only when needed.
  2. For output, use reader.Spec.Writer() when you need the same separator/culture as input.
  3. Control writer behavior with Sep.Writer(...) and SepWriterOptions (WriteHeader, Escape, DisableColCountCheck).
  4. Add async only where it brings value and your runtime is C# 13 / .NET 9+ for await foreach over async reader rows.
  5. Use ParallelEnumerate for CPU-heavy transformations only after benchmarking single-threaded baseline.

Install and read patterns

using var reader = Sep.Reader(o => o with
{
    HasHeader = true,
    Unescape = true,
    Trim = SepTrim.Both
}).FromText(data);

foreach (var row in reader)
{
    var id = row["Id"].Parse<int>();
    var name = row[1].ToString();
    // process row
}

Write patterns

using var reader = Sep.Reader().FromFile("input.csv");
using var writer = reader.Spec.Writer().ToFile("output.csv");

foreach (var row in reader)
{
    using var writeRow = writer.NewRow(row);
    writeRow["Amount"].Format(row["Amount"].Parse<double>() * 1.2);
}

Async reading and writing

var text = "A;B\n1;hello\n";

using var reader = await Sep.Reader().FromTextAsync(text);
await using var writer = reader.Spec.Writer().ToText();

await foreach (var row in reader)
{
    await using var writeRow = writer.NewRow(row);
    var normalized = row["B"].ToString().ToUpperInvariant();
    writeRow["B"].Set(normalized);
}

Common configuration patterns

Best practices

Limitations to check before production

Deliver

Validate

Load References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.