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
10
votes
8 answers

TypeError: parse is not a function on csv-parse

I ran into this issue after setting up a simple app using: node v16.13.2 npm v8.1.2 csv-parse v5.0.4 On VSCode v1.63.2 Code is: const parse = require('csv-parse'); const fs = require('fs'); const results =…
Jadeye
  • 3,551
  • 4
  • 47
  • 63
4
votes
0 answers

Error: Cannot create a string longer than 0x3fffffe7 characters while using createReadStream

I am parsing extremely large CSV files (~37gbs). I am using fs.createReadStream and csv-parser. I break them into 5000 rows and then insert those into a mongo db. This error happens even when the mongo portion is commented out, however. Here's the…
Aarmora
  • 1,143
  • 1
  • 13
  • 26
3
votes
2 answers

csv-parse is throwing Invalid Opening Quote: a quote is found inside a field at line

I know there are other posts out there but none of them seem to fix my issues. I am using csv-parse with node js. This is the CSV header and record that I'm trying to…
Just Me
  • 91
  • 4
  • 12
3
votes
1 answer

ignore what's inside quotes with csv-parse module in nodejs

I'm trying to write a csv parser to work with some very complex data and I'm having trouble making the csv-parse module ignore the delimiters inside quotes. I don't have control over how the data comes except maybe for the double quotes themselves,…
3
votes
1 answer

Unexpected behavior when using csv-parser node module

I'm trying to get the headers of a csv file into an array and attempting to use the csv-parser to do so. Two things I can't figure out here: 1) Why is the console.log on the last line of the code firing before anything else? This also means the…
alyslov
  • 95
  • 7
2
votes
2 answers

Jest tests fail after using 'csv-parse/sync' lirbary

I am using NestJs with Nx.dev for monorepo. After I installed csv-parse/sync and used my Jest tests don't work anymore. Jest encountered an unexpected token Jest failed to parse a file. This happens e.g. when your code or its dependencies use…
zedian
  • 397
  • 5
  • 16
2
votes
1 answer

First property inaccsesible of objects parsed by csv-parse

I am parsing a csv file with following contents using csv-parse - userID,sysID 20,50 30,71 However, on the objects returned it isn't possible to access the property created from the first column userID. Here is my code -- async function main(){ …
charsi
  • 2,917
  • 22
  • 40
2
votes
1 answer

npm csv-parse not reading all rows

I'm trying to read a CSV using csv-parse, but the final line isn't being read. My code: const handleFiles = event => { const f = event.target.files[0]; const parser = CsvParse({delimiter: ',', columns: true}); parser.on('readable',…
Votemike
  • 762
  • 1
  • 10
  • 28
2
votes
0 answers

How to eliminate headers from getting inserted in mySQL tables after converting Json to CSV data and then insert into mySQL using NodeJS

I have large json data which I convert to CSV (using NPM jsonexport). Then I use NPM csv-parse to insert this CSV Data into mySQL table using NodeJS. However 1 extra row having the column names is also inserted in the mySQL Table. How can I…
1
vote
1 answer

How to remove a entire record conditionally using npm "csv" or "csvtojson" package?

I wanted to store CSV values to an object variable using npm "csv" sync API by parsing it. // Read the CSV file synchronously const csvData = fs.readFileSync(csvFilePath, "utf-8"); // Parse the CSV data synchronously const parsedData =…
vishnu p s
  • 51
  • 6
1
vote
1 answer

Unable to push data into an array when reading csv using createReadStream

I am trying to store data from a csv file in an array using createReadStream in node.js but for some reason the array stays empty and no data is stored in it. When i console log the values where i'am trying to push the data it logs it just…
Zer0
  • 29
  • 3
1
vote
1 answer

CsvError: Invalid Opening Quote: a quote is found inside a field at line 9618

I have this error when I try to parse kepler_data.csv using csv-parse using promises following Adam and Andre Negoi NodeJS course. Here is the code: function loadPlanetsData() { return new Promise((resolve, reject) => { …
Sycan
  • 37
  • 8
1
vote
1 answer

Streaming and parsing a CSV file in the browser (node/webpack)

A while back, I put together a node project that was designed to run in the browser, and one of the main things it does is parse CSV files it streams from a server, and operates on them in chunks. When I initially put this together, IE11 was a…
chucklay
  • 137
  • 8
1
vote
0 answers

NodeJS s3 zip/csv download, can't read file

i'm using AWS's developer Reporting API in order to download a zip file containing a CSV sales report. My problem is, I cannot read this file and i can't for the life of me figure out why. Whilst on the server terminal, cat my.csv prints the file…
J.E.C.
  • 2,616
  • 2
  • 18
  • 21
1
vote
1 answer

How can I the take keys of some value from a type?

I tried to use csv-parse's option cast to convert the type. My approach is as follows, but there are problems. I referred to this answer: https://stackoverflow.com/a/60932900/19252706 Is it to possible to define KeysOfNumbers and…
張政鈞
  • 13
  • 2
1
2 3 4 5