From CSV to javascript – How to make data fit

Don’t let codes like this be an obstacle when you’ve got a lot of data. There are ways to make them all fit in with a few clicks.

[tweetmeme]By Martin Ove

Here’s a tip, I found out about while doing a project.

Sometimes you have a lot of data, that you want to fit into a certain format. This happened to me while trying to get Google Charts to work with my dataset, which was stored in pure .csv.

The javascript wanted it to look like this: data.addRow([“Name”, Data1, Data2, Data3]);

All I got was this, separated by tabulator: Name     Data1     Data2     Data3

I used Google Spreadsheets to automate the process of putting quotation marks, commas, and space in between the data, check out how below.

The process is extremely universal and might come in handy, if you don’t know it already. (more…)