Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Coffeescript Application Development Cookbook
  • Table Of Contents Toc
Coffeescript Application Development Cookbook

Coffeescript Application Development Cookbook

By : Hatfield
4.6 (5)
close
close
Coffeescript Application Development Cookbook

Coffeescript Application Development Cookbook

4.6 (5)
By: Hatfield

Overview of this book

If you are interested in developing modern applications, this book will help you leverage the vast JavaScript ecosystem while using an elegant language, helping you avoid the shortcomings of JavaScript.
Table of Contents (13 chapters)
close
close
12
Index

Parsing CSV files


One of the common tasks we face is the processing of textual data files.

In this recipe, we will parse a CSV-formatted file by using an NPM library that supports reading from an input stream. In our example, we want to parse a contact database collecting customer counts by state. Our goal is to see which states have the most customers.

Getting ready

We will be using the node-csv NPM module. We will begin by installing the module:

npm install csv --save

If we inspect our sample CSV file, we see the first three lines that follow:

"first_name","last_name","company_name","address","city","county","state","zip","phone1","phone2","email","web"
"James","Butt","Benton, John B Jr","6649 N Blue Gum St","New Orleans","Orleans","LA",70116,"504-621-8927","504-845-1427","[email protected]","http://www.bentonjohnbjr.com"
"Josephine","Darakjy","Chanay, Jeffrey A Esq","4 B Blue Ridge Blvd","Brighton","Livingston","MI",48116,"810-292-9388","810-374- 9840","[email protected]","http...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Coffeescript Application Development Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon