Questions tagged [fast-csv]

Fast-csv on GitHub is a library that provides CSV parsing and formatting for node applications.

It uses the MIT license.

As of v0.2.0 fast-csv supports multi-line values.

58 questions
0
votes
1 answer

Detect duplicate data on csv

With node.js using fast-csv package, I currently have this parsing function, which reads csv file, change headers, go through each row and fire an event based on row data. validateRows: (filePath, payload, validators) => new Promise((resolve,…
Atakan Bal
  • 27
  • 7
0
votes
1 answer

With fast-csv how do I call an asynchronous validator?

How do I call a function that returns a promise? const checkDatabase = async (row: Row): Promise => { return await checkDatabaseService.check() } With a pipeline such as parseStream(steam, {}) .validate(row: Row, processValidationError)…
Interlated
  • 5,108
  • 6
  • 48
  • 79
0
votes
1 answer

Add column to csv file javascript:nodejs

I would like to add a column to my csv file that contains the same data for all rows my csv file : sugar, 150, stock salt, 30, stock milk, 30, stockout my file after adding the row (expected result): product, sugar, 150, stock product, salt, 30,…
amelie
  • 3
  • 4
0
votes
1 answer

write headers in csv file with fast-csv

I am trying to add headers to my csv file using fast-csv my csv file : "nina", 24 "sarah", 25 const csv = require('fast-csv') const ws = fs.createWriteStream("/file.csv") ; csv.write({headers : ['name', 'age']} ) .pipe(ws) ; but it doesn't work…
Cissus
  • 15
  • 6
0
votes
1 answer

How to identify different input schemas with FastCSV?

The following code works fine with the "Winner" type. The tech is typescript with node streams. Sometimes someone uploads a winner-2 type though. I'd like to look at the header and change format type based on the header. I could possibly write a…
Interlated
  • 5,108
  • 6
  • 48
  • 79
0
votes
0 answers

How do I use async/await and .on() simultaneously in express.js with fast-csv?

I've set up a route to upload a .csv file, validate the data received, check that none of the rows exist in the database and finally upload the data once all validation checks have been performed. Below is the route in question: ... const Customer…
sylvahman
  • 13
  • 3
0
votes
2 answers

Nodejs fast-csv and promises

I feel like things are running out of order here. I want to establish a connection to a mySQL database. Then I want to read in a file. Row by row I want to grab the name and run a query. I would have assumed that my sqlSelectQuery function,…
eurodollars
  • 47
  • 1
  • 8
0
votes
1 answer

Send KnexJS error message to the frontend

I am having trouble sending an error to the front end when a csv file is uploaded and the numbers already exist in the database. The backend is logging an error that the primary key value already exist, but the code I have written tells the front…
0
votes
1 answer

fast csv alwaysWriteHeaders true wont work node js

I am new to node.js. I have to email the retrieved data in CSV format. I wrote code and it is working fine but with an empty array the headers are not included in the CSV, I get an empty excel sheet. I used var fastcsv = require("fast-csv"); var…
mural
  • 29
  • 1
  • 8
0
votes
1 answer

Export csv file using Azure functions nodejs

I am trying to export a csv file (pulling the data from mongodb). My frontend is ionic (angular) and backend is Azure function (nodejs), I want the frontend to be able to download this csv file. My code: const { db, connection } = await…
Exhaler
  • 105
  • 1
  • 9
0
votes
1 answer

How to integrate FastCSV into android project

how do I integrate https://github.com/osiegmar/FastCSV inside android kotlin project. There is no jar file or gradle implementation
Dim
  • 4,527
  • 15
  • 80
  • 139
0
votes
1 answer

stream s3 to dynamodb with fast-csv : not all data inserted

When a csv file is uploaded on my s3 bucket, my lambda will be triggered to insert my data into DynamoDB. I need a stream because the file is too large to be downloaded as full object. const batchWrite = async (clientDynamoDB, itemsToProcess) => { …
0
votes
0 answers

Copy data from CSV to postgres ignoring unique key violation

I'm trying to bulk insert data from CSV into the PostgreSQL database using the COPY SQL command. Usually the CSV file contains minimum of 10 thousand rows to maximum of one million rows. This CSV file contains queryId as one of the columns and this…
0
votes
1 answer

Sequelize - How to insert csv data into multiple tables in mysql using sequelize

What I'm using node.js, express, sequelize 6.3.3, fast-csv 4.3.1 and mysql database. What I have I have a CSV file with following headers and data. no, name, email, township, father_name, father_phone, mother_name, mother_phone, parent_township In…
Htet Phyo Naing
  • 464
  • 7
  • 20
0
votes
1 answer

nodejs with supertest, calling an endpoint twice for different test cases getting a Did you forget to wait for something async in your test?

i have a single endpoint where i call twice on 2 different describes to test different responses const express = require("express"); const router = express.Router(); const fs = require("fs"); const multer = require("multer"); const upload = multer({…
gdubs
  • 2,724
  • 9
  • 55
  • 102