Questions tagged [fast-csv]
50
questions
7votes
2answers
3kviews
Node.js fast-csv synchronously read file and return array
I am trying to read a .csv file and to assign it to an array with this code:
const fs = require("fs");
const csv = require("@fast-csv/parse");
let data = []
csv
.parseFile(&...
4votes
1answer
3kviews
TypeError: csv.fromPath is not a function
I'm using fast-csv to read my csv file but it gives me error like this
UnhandledPromiseRejectionWarning: TypeError: csv.fromPath is not a
function
Here is my code:
const fileRows = [];
console....
3votes
1answer
375views
Node Express Fast CSV download to client
I've set up a small node js BE app, built with express and fastCsv module on top of it. The desired outcome would be to be able to download a csv file to the client side, without storing it anywhere ...
2votes
1answer
357views
Trying to return 2D-array with fast-csv in Nodejs but returning none
I am attempting to parse a csv-file using fast-csv library and convert each values number or string to create 2d array.
But I can't return array in ReadStream.
Can you give me advice on my code?
const ...
2votes
0answers
279views
How do I handle errors properly with fast CSV?
In the code below, I want to check if the headers are valid and then stop reading the stream if they are and send an error back to the client (via my ErrorHandler function). I see the following in my ...
1vote
1answer
501views
Cannot push arrays to array - fast-csv, nodejs
I'm using fast-csv npm package to parse incoming csv file and catching event data and displaying row is absolutely OK. I got what I want here.
What I've done:
fs.createReadStream(req.file.path)
....
1vote
1answer
64views
With fast-csv how on data-invalid, how do I access the error object?
Using the fast-csv also supports async validation, with a callback example at
fast-csv examples
How do I get access to the error in the 'data-error' event?
The validate event has a callback with ...
1vote
1answer
62views
SequelizeUniqueConstraintError create method add only one row
I am trying to parse a csv file with fast-csv and at the end store all the lines in a database with sequelize
Here is my script to parse the data:
module.exports = async () => {
try {
let csvData ...
1vote
1answer
52views
"Failed to pipe. The response has been emitted already" when reading a stream (nodejs)
So my code is supposed to read some lines from a CSV file, convert them to an array of JSON objects, and return that array.
To read the file as a stream, I am using got, and then using it in fast-csv.
...
1vote
0answers
82views
Handling Asynchronous stream: Read and Write multiple csv files after filtering dates in nodejs
So I have a bunch of csv files which have more data then I require, I want to filter the data out by only having keeping the rows with dates after year 2015. The Problem is that it works for a single ...
1vote
0answers
247views
How to save coordinates in a csv file from an android app?
I am working on a project where I want to collect sensor data with coordinates and save them to a csv file.
The app was working perfectly before I started coding for getting the location.
I am using ...
1vote
0answers
118views
Progress bar to include in EJS
I am uploading a csv file using fast-csv and then submitting all its rows in fileRows Array.
Next I am rendering my webpage:
res.on('end', function () {
res.render("execute", {fileRows})
});
...
1vote
1answer
175views
Node.js: Return promises in a defined order
I have some hundreds of JSON files that I need to process in a defined sequence and write back the content as CSV in the same order as in the JSON files:
Write a CSV file with header
Collect an array ...
1vote
0answers
100views
Sending response to ipcRenderer from ipcMain after asynchronous operation completes
I'm learning Electron by writing the app that should parse and analyze .csv files. As a frontend part of it I'm using Vue.js. Initial functionality should be next: user selects a file, main process ...
0votes
2answers
249views
Writing 100,000 lines in a csv in fastest way possible
I m trying to create a zip of 100 csv.
I need to write 100,000 lines in a single csv in fastest way possible.
I am using openCSV, ZipEntry method to write to csv.
Some Code used:
ZipEntry ...