d3.csv可以在这里帮助你:
d3.csv('myCSVFile.csv', function(data){
//the 'data' argument will be an array of objects, one object for each row so...
var numberOfRows = data.length, // we can easily get the number of rows (excluding the title row)
columns = Object.keys( data[0] ), // then taking the first row object and getting an array of the keys
numberOfCOlumns = columns.length; // allows us to get the number of columns
});
Run Code Online (Sandbox Code Playgroud)
请注意,此方法假定电子表格的第一行(仅第一行)是列标题.