Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKarthikReddy Lingareddy
403 PointsHow to parse a CSV file?
I have data set which is in CSV format, how can I decode that?
2 Answers
Steven Parker
231,261 PointsCSV stands for "comma-separated values", so unless some of the fields contain commas, you can easily convert a line of data into an array with "dataString.split(',');
".
Fields that contain commas in the data will be enclosed in some way, often with quote marks. Decoding that would be a bit more involved but hopefully you won't have that issue.
Nick Coffey
1,657 PointsI found this project: https://github.com/vanillaes/csv
Could that be used for parsing CSV files to JSON?
Say files from here: https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_daily_reports