Skip to content

fix: ignore quoted header punctuation when detecting CSV delimiters - #25

Open
sshnox wants to merge 1 commit into
mafzalkalwardev:mainfrom
sshnox:fix/quoted-header-delimiters
Open

sshnox wants to merge 1 commit into
mafzalkalwardev:mainfrom
sshnox:fix/quoted-header-delimiters

Conversation

@sshnox

@sshnox sshnox commented Nov 4, 2026

Copy link
Copy Markdown

Summary

CSV delimiter detection counts commas, semicolons and tabs inside quoted header cells. A semicolon file beginning with "Name, company, team";Email is therefore parsed using commas: the header and data collapse into one column, and the email column index and original row cells are wrong.

Count only separators outside quoted fields, respecting doubled quotes and preserving the existing delimiter tie-breaking rules. Add the parser coverage requested in #21 and document CSV import behavior in the README.

Fixes #21.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / chore

Test plan

  • npm test passes locally: 26 tests on Node.js 24.22.1.
  • Tested manually (describe steps):

Nine tests call parseBulkFile with temporary CSV files. They cover ordinary comma/semicolon/tab files, a BOM, an email in a later column, quoted comma data, four quoted-header regressions (including escaped quotes), and deduplication while retaining original rows and indexes. Four of the nine tests fail against the unchanged implementation; all pass with this fix.

node --check on both JavaScript files and git diff --check pass. No manual UI or live SMTP verification was performed; this change is confined to CSV delimiter detection.

Checklist

  • No secrets or .env files committed
  • README or SETUP.md updated if user-facing behavior changed
  • PowerShell scripts use ASCII only (no smart quotes); none changed

Screenshots (if UI change)

No UI changes.

Developed and tested with Codex assistance.

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.

Add tests for CSV email parsing

1 participant