My knowledge of JavaScript is limited, but I am wanting to load a CSV file into an array of dictionaries. I have attached an example of the style that I am after, however, this would have to be dynamically changed as some tables could be quite large?
Example CSV:
Vehicle ID, Vehicle Name, Category, KM
0001, Yaris, commute, 12560
0002, z350, personal, 5600
0003, Porche, business, 21040
Example Array:
var vehicles = [
{
"Vehicle ID": "0001",
"Vehicle Name": "Yaris",
"Category": "commute",
"KM": "12560.00"
},
{
"Vehicle ID": "0002",
"Vehicle Name": "Z350",
"Category": "personal",
"KM": "5600.09"
},
{
"Vehicle ID": "0003",
"Vehicle Name": "Porche",
"Category": "business",
"KM": "21040.70"
}
];
Any help would be greatly appreciated.
Cheers