Skip to content

Add CSV import/export to Multiple replace (#12015)#12019

Merged
niksedk merged 1 commit into
mainfrom
feature/multiple-replace-csv-12015
Jun 30, 2026
Merged

Add CSV import/export to Multiple replace (#12015)#12019
niksedk merged 1 commit into
mainfrom
feature/multiple-replace-csv-12015

Conversation

@niksedk

@niksedk niksedk commented Jun 30, 2026

Copy link
Copy Markdown
Member

What

Adds CSV as an import/export format for Multiple replace rules, for portability (editing rules in a spreadsheet, sharing as a simple table). Requested in #12015.

Multiple replace already imported/exported rule categories as JSON .template files; this adds .csv alongside it.

Details

  • Implemented the (previously empty stub) CsvExporter and CsvImporter with RFC 4180 quoting and a compliant parser, so Find/ReplaceWith values containing commas, double quotes ("") and line breaks round-trip correctly.
  • Columns: Category,Find,ReplaceWith,Description,Active,Type. Header row is optional on import (columns matched by name, else by position); empty CategoryDefault; unknown TypeCaseInsensitive. Export writes UTF-8 with BOM so non-ASCII rules open correctly in Excel.
  • Wired .csv into the existing import/export file pickers, routing by extension (.csv → CSV, .template → JSON / SE4 XML).
  • Documented the format in docs/features/edit.md.

Verification

Round-trip tested against the built assembly with tricky values (commas, embedded quotes, embedded newlines, regex \d+,\s, empty fields, multiple categories) — export → import reproduces every rule exactly.

Category,Find,ReplaceWith,Description,Active,Type
"Cat, A","hello, world","say ""hi""","line1
line2",true,RegularExpression
Default,foo,bar,simple,true,CaseInsensitive

Fixes #12015

🤖 Generated with Claude Code

Multiple replace already imported/exported rule categories as JSON .template
files; add CSV as an alternative format for portability (editing rules in a
spreadsheet / sharing as a simple table).

- Implement the (previously empty) CsvExporter/CsvImporter with RFC 4180
  quoting and a compliant parser, so Find/ReplaceWith values containing commas,
  quotes or newlines round-trip. Columns: Category,Find,ReplaceWith,Description,
  Active,Type. Header row optional on import; UTF-8 BOM on export for Excel.
- Wire .csv into the existing import/export pickers, routing by file extension.
- Document the CSV format in docs/features/edit.md.

Verified export->import round-trips exactly for commas/quotes/newlines/regex.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niksedk niksedk merged commit 8acc863 into main Jun 30, 2026
1 of 3 checks passed
@niksedk niksedk deleted the feature/multiple-replace-csv-12015 branch June 30, 2026 10:45
@faon-92

faon-92 commented Jun 30, 2026

Copy link
Copy Markdown

Bravo

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.

import / export inside multiple replace

2 participants