CSV Delimiter Auto-Detect avatar

CSV Delimiter Auto-Detect

Pricing

from $2.00 / 1,000 delimiter decideds

Go to Apify Store
CSV Delimiter Auto-Detect

CSV Delimiter Auto-Detect

Detect the delimiter, quote char, header presence, and encoding of any CSV/TSV/PSV file from a small sample. Outputs a `delimiter_decision` row with confidence and alternatives.

Pricing

from $2.00 / 1,000 delimiter decideds

Rating

0.0

(0)

Developer

Nikita S

Nikita S

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

13 days ago

Last modified

Share

Stop guessing. Feed in any CSV/TSV/PSV/text file, get back a single decision row with the delimiter, quote char, header presence, encoding, confidence, and top-2 alternatives.

Pure JavaScript, zero dependencies. Pairs with every other CSV Actor in the portfolio (csv-dedupe-normalizer, csv-schema-profiler, csv-coerce-types, csv-quality-scorecard, csv-join-enricher, csv-diff, csv-statistical-summary).

How it scores

For each candidate delimiter (, \t ; | by default):

  1. Split the sample into rows.
  2. Find the most common column count.
  3. Score the fraction of rows that have that count (consistency).
  4. Score the per-column type consistency (numeric / date / text uniformity).
  5. Detect header presence by checking whether row 0's types differ from the rest.

Composite score = 0.5 * consistency + 0.4 * typeUniformity + 0.1 * headerBonus.

Use cases

  • The single most common "I can't load this CSV" pain in n8n / Make / Google Sheets — the file uses ; (European Excel), \t (TSV), | (pipe), or , (US default) and the user doesn't know which.
  • Auto-route files into the right downstream Actor: pass the detected delimiter into csv-coerce-types or csv-dedupe-normalizer.
  • Audit a partner's data feed: "they keep sending PSV and we keep parsing it as CSV".

Input

FieldDescriptionDefault
textInline sample text. Use this OR url.
urlPublic URL of a CSV/TSV/PSV file.
candidatesCharacters to consider (use \t for tab).`,\t;
sampleBytesSample size to probe (1 KB to 64 KB).8192

Output

{
"_kind": "decision",
"url": null,
"encoding": "utf-8",
"delimiter": ";",
"quoteChar": "double",
"hasHeader": true,
"rows": 4,
"columnCount": 3,
"confidence": 0.94,
"alternatives": [
{ "delimiter": ",", "score": 0.41, "rows": 4, "columnCount": 1 },
{ "delimiter": "\\t", "score": 0.30, "rows": 4, "columnCount": 1 }
]
}

Run locally

npm install
npm test # 10 cases

Pricing / cost expectations

Default 256 MB / 512 MB. Reads at most 64 KB of the input (configurable via sampleBytes). Pay-per-event scheduled to activate after public launch: 1 charge per delimiter_decided event.

  • ../csv-header-normalizer — once you know the delimiter, normalize the headers.
  • ../csv-schema-profiler — per-column type inference.
  • ../csv-dedupe-normalizer — dedupe + header normalization.
  • ../csv-quality-scorecard — full data-quality scorecard.

FAQ

Does it detect the quote char? Yes, both ' and " are scored and the best is chosen.

Does it handle UTF-8 BOM? Yes — the encoding field is set to utf-8-bom and the BOM is stripped before scoring.

Does it work on one-line samples? Single-row CSVs get a low confidence score (the detector needs at least 2 rows to be confident).