rows = {
let comments = "";
const data = d3.csvParse(text, row =>
comments || String(Object.entries(row)[0][1]).match(/^#/)
? ((comments = comments.concat(
Object.values(row)
.filter(d => d)
.join(",") + "\n"
)),
null)
: row
);
return Object.assign(data, { comments });
}