CsvReader class abstract final

Reads CSV text (RFC 4180) into a one-sheet Workbook.

  • Fields may be quoted; inside quotes, "" is a quote and the field may hold the delimiter and line breaks.
  • Lines end in CRLF, LF or CR. A trailing line break doesn't add a row.
  • A leading byte-order mark is dropped.
  • The delimiter is , unless the first line has more ;, tabs or | (spreadsheets saved in locales that use , for decimals write ;).
  • Fields that are plain numbers become numbers (so a selection can sum them) but keep their written form on screen: 007 stays 007.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

detectDelimiter(String text) → String
,, ;, tab or |: whichever appears most on the first line, outside quotes.
parse(String text, {String delimiter = ','}) → List<List<String>>
The records in text, each a list of fields.
read(String text, {String sheetName = 'Sheet1', String? delimiter}) → Workbook
Parses text into a workbook with one sheet named sheetName. delimiter overrides detection.