csv2json is a csv parser and json converter based on d3 csv implementation. Most of the code is taken directly from d3.
Download csv2json.min.js or do bower install csv2json
.
<script src="csv2json.min.js"></script>
csv2json.dsv takes a third parameter headers
which stands for the number of header rows. Currently this can be 1 or 2, the default being 1.
csv2json.dsv(delimiter, mimeType, headers)
Constructs a new parser for the given delimiter and mime type. This parser is a standard csv parser, which assumes two header rows:
var dsv = d3.dsv(",", "text/plain", 2);
API: https://github.com/ile/csv2json/wiki/CSV
Original: https://github.com/mbostock/d3/wiki/CSV