Guest User

Untitled

a guest
Jul 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. const parse = require('csv-parse')
  2. const fs = require('fs')
  3.  
  4. fs.readFile('./input.csv', (err, data) => {
  5. if (err) throw err;
  6.  
  7. // cell quotes are denoted with "
  8. parse(data, { quote: '"' }, (err, output) => {
  9. if (err) {
  10. throw err
  11. }
  12. output.forEach(row => {
  13. row.forEach(column => {
  14. process.stdout.write(column + " ")
  15. })
  16. });
  17. })
  18. });
Add Comment
Please, Sign In to add comment