Created
November 21, 2017 16:39
-
-
Save rxluz/01362cddde284d300185fab1da40e42c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| const fastCsv = require('fast-csv'); | |
| var fileStream = fs.createReadStream("machineData_clean_Cafe.csv"), | |
| parser = fastCsv(); | |
| fileStream | |
| .on("readable", function () { | |
| var data; | |
| while ((data = fileStream.read()) !== null) { | |
| parser.write(data); | |
| } | |
| }) | |
| .on("end", function () { | |
| parser.end(); | |
| }); | |
| parser | |
| .on("readable", function () { | |
| var data; | |
| while ((data = parser.read()) !== null) { | |
| console.log(data); | |
| } | |
| }) | |
| .on("end", function () { | |
| console.log("done"); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment