Skip to content

feat: read CSV from stdin in headless modes (Closes #320) - #484

Open
cemheren wants to merge 4 commits into
mainfrom
grow/stdin-input
Open

feat: read CSV from stdin in headless modes (Closes #320)#484
cemheren wants to merge 4 commits into
mainfrom
grow/stdin-input

Conversation

@cemheren

Copy link
Copy Markdown
Owner

What

Adds support for piping CSV into QuickSheet's headless export modes by passing - as the input file argument:

cat data.csv | ExcelConsole - --export-md -
curl -s https://example.com/data.csv | ExcelConsole - --export-json out.json

Works for --export-md, --export-html, and --export-json (the headless modes that currently exist; the issue also mentioned --info/--sort which aren't implemented yet).

How

  • New GridManager.LoadFromCsvLines(IReadOnlyList<string>) overload so pre-read lines (from stdin) populate the grid without a temp file. LoadFromCsv(path) now delegates to it.
  • New Program.ReadCsvInput(csvPath) helper: reads stdin via Console.In when csvPath == "-", otherwise reads the file (returns null if missing).
  • Help text documents the - stdin convention.

Verification

  • printf 'a,b\n1,2\n3,4\n' | ExcelConsole - --export-md - → correct Markdown table.
  • stdin → JSON verified.
  • Existing file-path behavior unchanged; missing file still errors with exit 1.
  • dotnet build — 0 warnings, 0 errors.

Closes #320

cemheren and others added 4 commits June 22, 2026 19:01
Correct faulty 'pile draining' reads (gh default page size is 30, true
count was 113). Close all skill-only PRs that violated the direct-to-main
rule. Add standing rule: never open PRs for skill-only changes.
Pass - as the input file argument to pipe CSV into --export-md,
--export-html, and --export-json, e.g.:

  cat data.csv | ExcelConsole - --export-md -

Adds GridManager.LoadFromCsvLines so pre-read lines (from stdin) can
populate the grid without a temp file. File-path behavior is unchanged.

Closes #320

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support reading CSV from stdin (pipe)

1 participant