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

Reading from multiple CSV files and writing into one using streams

My program takes in CSV files and attempts to merge them into one CSV file. All of the CSV files will have the same columns. I am using the fast-csv package to parse and format the rows of the CSV files, but I am having trouble getting them to all…
LZip96
  • 3
  • 2
0
votes
1 answer

What is the difference between the parsing and formatting methods in fast-csv for Node?

My understanding is that they both create writeable streams, but I'm unsure of what the point of parsing the data is if you just go and format it afterwards like in the example below. fs.createReadStream(path.resolve(__dirname, 'assets',…
LZip96
  • 3
  • 2
0
votes
2 answers

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 zipentry = new…
NobesInd
  • 77
  • 6
0
votes
1 answer

nodejs - streaming csv to string variable

I have a code that accepts a list of nested objects, each of which should be converted to a log row. The code goes through a loop on each object, then an inner loop on each property, and extracts its property (there are hundreds of properties), then…
Zag Gol
  • 1,038
  • 1
  • 18
  • 43
0
votes
2 answers

TypeError: csv.fromPath is not a function (convert csv file to sha1 script)

im trying to execute a sample script that reads a CSV file. and then make the data into SHA1 hash. I copied the sample from this git: https://gist.github.com/cdurth/6735c82cd11c5a057bd4 I get this…
Michael
  • 43
  • 8
0
votes
0 answers

CSV parse multiple files

My goal: I need to grab N number of files from an FTP, parse them, and send the parsed data somewhere. My current implementation is working fine but when I get past the first file it begins to hang. The package I am using for the csv stream / parse…
0
votes
0 answers

Issues reading a small CSV file in Node

ISSUE: I am trying to use Nodejs streams to read a small CSV file (1 row) using the fast-csv module. The CSV 'rows' are pushed to an array(rows []) when the 'data' event is emitted. When 'end' is emitted, the data is update in a DB. However, the…
0
votes
0 answers

Stream Mongoose Result as CSV stream Response on hapi.js v.17

I'm basically trying to: Query stream to MongoDB using mongoose Transform stream result using fast-csv Return stream response How can I do that properly? Here's my handler code async function handler(req, h) { const fastCsv =…
FyzD
  • 1
0
votes
1 answer

Adding header to output csv from fast-csv package

I am generating a CSV file from an SQL Query using the fast-csv node package. Here is the relevant bit of code. const dataStream = client.query(copyTo(q)); const writeStream = …
DrkStr
  • 1,752
  • 5
  • 38
  • 90
0
votes
1 answer

Read and write to csv file with Node.js fast-csv library

I may be lacking some in depth understanding of streams in general. However, I would like to know how efficiently what I need should work. I want to implement so that a csv file would be read, then to each row a query to the database (or api) is…
r.Die
  • 125
  • 3
  • 14
0
votes
1 answer

How to convert an async function which returns promise to sync function in node js

I am using fast-csv npm library, where I wanted to use writeToString formatter function https://github.com/C2FO/fast-csv/blob/HEAD/docs/formatting.md#csv-write-to-string Current I write like const csvString = await…
0
votes
1 answer

How do I read an CSV file in an EC2 instance folder as oppose to an S3 bucket in AWS?

I wrote a script with fast-csv that can read an excel file in amazon s3 and then take the data and store it in mySQL. I now have an ec2 instance set and created a folder titled "upload" and housed the CSV file in there. My question is how do I read…
ddobson001
  • 91
  • 1
  • 5
-2
votes
2 answers

cannot upload csv file on nodejs server

I am trying to upload a csv file through react at frontend & node.js server and store it in an array. I have used fast csv module to parse this csv file but fast csv module is asking for a buffer or url . My react is sending me an blank object. I am…
Kunal Kumar
  • 39
  • 12
1 2 3
4