Using Fast-csv Not Reading Csv File
I am trying to first read the CSV file, but I am getting an error saying: TypeError: fs.createReadStream is not a function. Am I doing something wrong? Here is my code: fs.create
Solution 1:
I realized that i did not have the file inside my project, which is the reason it was not reading it, also, i changed my code to this.
const csv = require('csv-parser');
const fs = require('fs');
const fast = require('fast-csv');
fs.createReadStream('accounts.csv')
.pipe(csv())
.on('data', (row) => {
console.log(row);
})
.on('end', () => {
console.log('CSV file successfully processed');
Post a Comment for "Using Fast-csv Not Reading Csv File"