Add CSV import/export to Multiple replace (#12015)#12019
Merged
Conversation
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>
|
Bravo |
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 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
.templatefiles; this adds.csvalongside it.Details
CsvExporterandCsvImporterwith RFC 4180 quoting and a compliant parser, soFind/ReplaceWithvalues containing commas, double quotes ("") and line breaks round-trip correctly.Category,Find,ReplaceWith,Description,Active,Type. Header row is optional on import (columns matched by name, else by position); emptyCategory→Default; unknownType→CaseInsensitive. Export writes UTF-8 with BOM so non-ASCII rules open correctly in Excel..csvinto the existing import/export file pickers, routing by extension (.csv→ CSV,.template→ JSON / SE4 XML).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.Fixes #12015
🤖 Generated with Claude Code