本文へ移動

@eightkk/vue-weave / core / parseCsv

Function: parseCsv() ​

parseCsv(text, options?): string[][]

Defined in: src/core/interchangeCsv.ts:116

Parse RFC 4180 CSV text into records of fields, the inverse of toCsv. Records end with CRLF, LF or a lone CR, and a final line break is optional. Fields enclosed in double quotes can contain the delimiter, line breaks and doubled quotes ("" is one quote). A quote inside an unquoted field is kept as text. A leading byte order mark is removed. Every field is a string; an empty line is a record with one empty field, and empty text has no records.

Throws an Error with the line and column for an unterminated quoted field or text after a closing quote, and an Error for an invalid delimiter.

Parameters ​

text ​

string

options? ​

CsvParseOptions = {}

Returns ​

string[][]

MIT ライセンスで公開しています。