Skip to content

Simple, cross-platform Dart class to write CSV data to a StringSink

License

Notifications You must be signed in to change notification settings

d-markey/csvwriter

Repository files navigation

csvwriter

Lightweight, cross-platform Dart package to write CSV data to a StringSink. Supports and extends RFC 4180.

Usage

import 'dart:io';

import 'package:csvwriter/csvwriter.dart';

void main() async {
  var numbersFile = File('number_props.csv');
  var numbersCsv = CsvWriter.withHeaders(numbersFile.openWrite(), ['Number', 'Odd?', 'Even?']);

  try {
    for (var i = 0; i < 100; i++) {
      numbersCsv.writeData(data: {'Number': i, 'Odd?': (i % 2) != 0, 'Even?': (i % 2) == 0});
    }
  } finally {
      await numbersCsv.close();
  }
}

About

Simple, cross-platform Dart class to write CSV data to a StringSink

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages