The parsing options
Optional Readonlyheader?: booleanReads the first row as column labels, keying records by label rather than by positional
index; defaults to false
Optional Readonlyskip?: booleanIgnores empty lines rather than emitting them as records; defaults to false
Optional Readonlytrim?: booleanStrips surrounding whitespace from field values; defaults to false
Optional Readonlyflex?: booleanEmits records whose field count doesn't match the header, leaving out missing fields and
discarding fields beyond the header, rather than skipping them; defaults to false
Optional Readonlyquote?: stringThe character wrapping field values; defaults to " if unset or empty
Optional Readonlydelimiter?: stringThe character separating fields; defaults to , if unset or empty
A task converting a feed of CSV documents, given as text or as responses, into a feed of records
Error While the feed is consumed, whatever the source reports while producing documents, or whatever reading the body of a response reports
Creates a CSV parser.
The generated task converts a feed of CSV documents into a feed of records, one Record per data row, so that a consumer works on structured data rather than on text.
A document is given either as text or as a response carrying it as its body, and is read on its own, header row included. A response carrying no body contributes no record.
Response bodies are decoded as the
charsetparameter of the content type states, and as UTF-8 where it states none, whatever the US-ASCII default carried by thetextmedia types, as UTF-8 is what CSV is exchanged under in practice. A byte order mark opening a document is stripped, both from text and from a body decoded under a Unicode charset.A response stating a content type other than
text/csvorapplication/csv, or a charset the platform doesn't decode, is reported to the log and read all the same, the body decoded as UTF-8 where the charset is not known, so that a mis-declared source is diagnosed without being shut out: CSV is served undertext/plainand vendor types as readily as undertext/csv.Records that cannot be parsed are skipped and reported to the log, leaving the feed to run to completion.