Skip to main content

parseCsv

@forge/monorepo


@forge/monorepo / backend/src / parseCsv

Function: parseCsv()

parseCsv(text, options?): CsvResult

Defined in: backend/src/toolkit/data.ts:33

Parse CSV.

Handles the part people get wrong -- quoted fields containing commas, newlines and escaped quotes -- and nothing else. No type inference: a column of 01234 is a zip code and a column of 1-2 is not a date, and a parser that guesses produces data a model then reasons about incorrectly. Everything comes back as a string, which is what it was.

Parameters

text

string

options?

delimiter?

string

maxRows?

number

Returns

CsvResult