Questions tagged [node-csv-parse]

csv-parse is a parser for Node.js converting CSV text input into arrays or objects. It implements the stream API.

See npm page

73 questions
1
vote
1 answer

When using node-csv-parse, can you specify some fields to be text-qualified and some not?

Using SSDT, I can specify whether individual fields are text-qualified or not. This is useful for a CSV that I'm parsing where only one of the fields is text qualified (I can't easily ask for an export where all the fields are text qualified). Using…
Zach Smith
  • 8,458
  • 13
  • 59
  • 133
0
votes
0 answers

How to add a new column and insert values in csv using node js?

I have generated a npm-audit.csv file by running npm audit --json | npm-audit-csv in cmd. This is an example of the csv result: Package Name Severity Vulnerability Vulnerability Found in Adivisory dottie high dottie vulnerable to Prototype…
anon_jj
  • 1
  • 1
0
votes
1 answer

Stream behaviour is different after upgrading from Node 14 to Node 18

I'm new to Node.js and I need to upgrade the node version of a project from Node 14 to Node 18. Almost all things are working but one of the unit tests failed. Here's the unit test: import { ValidationError } from "../../errors" import {…
Alex Lam
  • 166
  • 6
0
votes
0 answers

MongoExpiredSessionError while inserting large csv data to mongodb

I am using a CSV parser package to transform a large volume of CSV data and then attempting to store this data within a MongoDB database. Although a portion of the data is successfully saved into the database, I encounter an issue after processing a…
Hasan
  • 43
  • 6
0
votes
0 answers

I want to add product to shopify using javascript and csv/excel sheet

I have exported a CSV file from my Shopify store. My goal is to automatically add any new products added to the CSV file to my store. To achieve this, I have installed the csv-parser and shopify-api-node packages in my Node.js environment.…
Anik Dev
  • 63
  • 4
0
votes
0 answers

Import large CSV file using Node and not block new request

My intention is to import thousands of lines from a csv file into the database using node. But I don't want to wait for server response. I want to be able to make new requests and when the csv reading/import process is finished, print with a…
Wagner Fillio
  • 395
  • 3
  • 19
0
votes
1 answer

CSV reading and using output, error with using data asynchronously

I am attempting to read a CSV document and use its data to work out the cost of a sandwich. I am struggling as at first I was doing it as follows: const entries = [] fs.createReadStream("./sandwiches.csv") .pipe(parse({ delimiter: ",", from_line:…
Chris
  • 76
  • 1
  • 7
0
votes
0 answers

How to parse =,"" csv files using csv-parse

I am using csv-parse/sync library and trying to parse a .csv file that has this structure. ="212600300516","1122133",="****5401",="000272", I am using this configurations const { parse } = require("csv-parse/sync"); const records = parse(text,…
Missak Boyajian
  • 1,965
  • 7
  • 32
  • 59
0
votes
2 answers

Confusion between buffer file and csv when using csv-parse in nodejs

I want to parse a csv file coming from a react app. I have a controller which gets the csv file: @Post(':id/transactions/upload') @UseInterceptors(FileInterceptor('file')) uploadTransactions( @Body() body: any, @UploadedFile() file:…
AlbertMunichMar
  • 1,680
  • 5
  • 25
  • 49
0
votes
1 answer

bare bone csv-parse won't parse anything

with the below code I expect to see records being printed. But I get radio silence. No error or any records being printed. CSV file content and located in same folder as…
0
votes
0 answers

nodeJS - csv parse with createReadStream, how can every chunk be converted to an object

I was using the csv-parse package with the createReadStream method. fs.createReadStream('rando.csv') .pipe(parse({ comment: '#', columns: true, })) .on('data', (data) => { console.log(data); }) The…
0
votes
1 answer

Return value not fulfilled

I don't understand why the last console.log returns 'Promise { pending }' without any log. When I can see the result when I uncomment the console.log in the GetInfo function. How can I fix that issue and get my records array from GetInfo? const fs =…
M.K.
  • 3
  • 2
0
votes
1 answer

NodeJs csv-parse await inside on('data')

I have a code, which reades .csv line by line and saves each parsed row to the database const csv = require('csv-parse') const errors = [] csv.parse(content, {}) .on('data', async function (row: any) { const error = await…
Bogdan Timofeev
  • 1,062
  • 3
  • 11
  • 33
0
votes
0 answers

csv-parse invalid record length for fields with quotes

I am trying to parse the below two records. I asked a question earlier that fixed the record I had been trying to parse, but now my client is saying the below two records don't work. I'm also getting a different error this time: Invalid Record…
Just Me
  • 91
  • 4
  • 12
0
votes
1 answer

Cannot set headers after they are sent to the client while parsing data in node js

I am using csv parser to read csv file and passing received data of csv file to ejs template file to print so the data is in object format, so I have used stringyfy but getting error due to this. Error: Error [ERR_HTTP_HEADERS_SENT]: Cannot set…
faraz
  • 223
  • 2
  • 11