feat: read CSV from stdin in headless modes (Closes #320) - #484
Open
cemheren wants to merge 4 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds support for piping CSV into QuickSheet's headless export modes by passing
-as the input file argument:Works for
--export-md,--export-html, and--export-json(the headless modes that currently exist; the issue also mentioned--info/--sortwhich aren't implemented yet).How
GridManager.LoadFromCsvLines(IReadOnlyList<string>)overload so pre-read lines (from stdin) populate the grid without a temp file.LoadFromCsv(path)now delegates to it.Program.ReadCsvInput(csvPath)helper: reads stdin viaConsole.InwhencsvPath == "-", otherwise reads the file (returns null if missing).-stdin convention.Verification
printf 'a,b\n1,2\n3,4\n' | ExcelConsole - --export-md -→ correct Markdown table.dotnet build— 0 warnings, 0 errors.Closes #320