Skip to content

Add configurable and auto-detected CSV separators#13

Merged
enijburg merged 1 commit into
mainfrom
codex/add-customizable-csv-separator-support
May 15, 2026
Merged

Add configurable and auto-detected CSV separators#13
enijburg merged 1 commit into
mainfrom
codex/add-customizable-csv-separator-support

Conversation

@enijburg
Copy link
Copy Markdown
Owner

Motivation

  • Allow CSV mode to handle files that use different delimiters and let users override or let the viewer pick the best delimiter automatically.
  • Improve CSV rendering alignment for non-comma-separated files and support \t escape for tab separators.

Description

  • Add an optional CLI flag --csv-separator (Args::csv_separator) to accept a single ASCII separator or \t and thread it into Viewer::open as Option<&str>.
  • Implement resolve_csv_separator, parse_csv_separator and detect_csv_separator to parse a user-provided separator or auto-detect among candidates [',',';','\t','|',':'] by sampling lines.
  • Store the chosen separator in Viewer as csv_separator: Option<u8>, change index_csv_column_widths to accept a separator: u8, and update rendering in render_line to use the configured/detected separator for alignment and display.
  • Add unit tests for separator detection and parsing and update existing CSV-related test helpers and call sites to the new function signatures.

Testing

  • Ran code formatting with cargo fmt (succeeded).
  • Ran the test suite with cargo test and all tests passed (20 passed; 0 failed).

Codex Task

@enijburg enijburg merged commit 4e75450 into main May 15, 2026
1 check passed
@enijburg enijburg deleted the codex/add-customizable-csv-separator-support branch May 15, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant