Hoping someone way clever than me can quickly help solve this. I have csv files coming in with a semicolon seperator. it cant read the headings:
d3.csv("file.csv", function(error, data) {
data.forEach(function(d) {
d.date = parseDate(d.date);
d.value2 = +d.value2;
d.value1 = +d.value1;
});
I've tried adding something like data.replace(/\s*;\s*/g, ",") but doesnt work.
Appreciate the help.
Let's convert my comment to an answer, so it's not left unanswered:
Assuming that your values are separated by a semicolon (so technically it's not a CSV anymore), you might want to look at this: https://github.com/d3/d3-dsv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With