CsvLoader.withHeaders constructor

CsvLoader.withHeaders(
  1. Stream<String> stream, {
  2. Encoding encoding = utf8,
  3. String separator = _defSeparator,
  4. String endOfLine = _defEndOfLine,
})

Builds a new CsvLoader bound to stream. The first non-empty line from the CSV data source will be used to populate the CsvData.headers; headers are not provided in the rows stream. separator (default is ',') and endOfLine (default is '\r\n') can be overriden. Using this constructor, data may be read by header name and/or index.

Implementation

CsvLoader.withHeaders(Stream<String> stream,
    {Encoding encoding = utf8,
    this.separator = _defSeparator,
    this.endOfLine = _defEndOfLine})
    : hasHeaders = true {
  _processor = CsvProcessor(stream, separator, endOfLine, hasHeaders);
}