-
-
Save karbassi/9354425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example cars.csv: | |
Year,Make,Model,Length | |
1997,Ford,E350,2.34 | |
2000,Mercury,Cougar,2.38 | |
*/ | |
d3.csv('cars.csv', function(data) { | |
// To headers once | |
var headers = Object.keys(data[0]); | |
console.log(headers); | |
// For each row outputs: ["Year", "Make", "Model", "Length"] | |
data.forEach(function(row) { | |
console.log(Object.keys(row)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment