A parser for CSV (comma-separated value) data. This format is extensively used to retrieve data for further 3D visualization in e-commerce, data analytics, and data science.


.parse(s : String, dialect : Object) → Array

s — input data in textual form.
dialect — CSV dialect.

dialect is a JavaScript object with the following structure:

const dialect = { delimiter: ",", // columns delimeter character doublequote: true, // allow double quotes lineterminator: "\n", // line terminator character quotechar: '"', // quotation character skipinitialspace: true, // skip initial space in input string skipinitialrows: 0 // skip initial row (e.g. used to represet column labels) };

Parse CSV string and return an array of rows. Each row is also an array which represents columns of the input data.


Check out the read CSV puzzle to parse CSV data in a visual way.


For more info on how to obtain the source code of this module see this page.