From the course: D3.js Essential Training for Data Scientists

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Parsing a CSV file

Parsing a CSV file - D3.js Tutorial

From the course: D3.js Essential Training for Data Scientists

Start my 1-month free trial

Parsing a CSV file

- [Instructor] Even if you've never created a database, you've probably come across a CSV file, because Excel worksheets can be saved in this format. CSV stands for comma-separated value. If you have access to the exercise files, look to find prices dot CSV, and open it up. If not, you can create your own file in Excel. Just fill the first column with dates, and the second column with numbers. Be sure to place the word month in cell A1, and the word price in B1. In my file, the first data point on each row, is a date in American date format. The second data point is a price value, in dollars, with a dollar sign. Then go File, Save As CSV. And save it in the same directory you are using for all your other files. Call it prices dot CSV. Create a new JavaScript file now. And save it as prices dot JS. We can close down shapes dot JS now. And you need to re-link your D3 dot HTML page, like so. So now if you go and preview in Firefox you should have a blank page. Now we're going to write a…

Contents