Questions tagged [json2csv]

Javascript module that converts JSON into CSV with column titles and proper line endings. Can be used as a module and from the command line.

58 questions
0
votes
1 answer

Converting Json to CSV using command line(JQ,json2csv, Python, other)

I am wanting to write a script to fetch information then returning Json file filter Json file then converting that Json to CSV. I have figured out steps 1 and 2, but am stuck on steps 3. Currently I have to use an online Json to CSV converter to…
Joseph
  • 5
  • 3
0
votes
1 answer

Transforming large array of objects to csv using json2csv

I need to transform a large array of JSON (that can have over 100k positions) into a CSV. This array is created directly in the application, it's not the result of an uploaded file. Looking at the documentation, I've thought on using parser but it…
PedroSG
  • 466
  • 2
  • 9
  • 38
0
votes
1 answer

JSON to CSV/Excel in Nodejs

I am trying to convert the JSON: Results: console.log((${JSON.stringify(results)}); [ [{"field":"StudentID","value":"A"},{"field":"Total Marks","value":"27853"}],[{"field":"StudentID","value":"B"},{"field":"Total…
raosa
  • 119
  • 1
  • 8
0
votes
1 answer

How to format values using json2csv in javascript?

I'm using json2csv v5.0.6 for a small project and I wanted to format some values using custom formatters so I get a clean CSV file. However, I can't seem to make the formatters work. I have one number formatter and one string formatter that are…
kluu
  • 2,848
  • 3
  • 15
  • 35
0
votes
0 answers

How to add extra line on first line of CSV file and also insert "," but not split in new rows while CSV generation and remove it while processing back

I am using two node packages json2csv for CSV generation and csvtojson for converting back csv to json. My use case is I am trying to add instruction on first line of CSV file while generating the CSV file and I would have to remove the exact first…
Ashish Choubey
  • 407
  • 1
  • 5
  • 17
0
votes
1 answer

json2csv not downloading proper data columns wise

i am using json2csv in tow routes and passing array of objects while it's working perfect on single route and on 2nd route it sums all the values in single _id column and rest colums like $init, $, error etc.
Ihtisham Tanveer
  • 338
  • 4
  • 15
0
votes
1 answer

Download large csv file using json2csv in node js

i am using json2csv package for downloading my data it is working fine for small data. but if the records are more then 300 values it gets crashed. here is my code const csvString = json2csv.parse(responseData); …
Ihtisham Tanveer
  • 338
  • 4
  • 15
0
votes
1 answer

Convert a JSON to CSV in Node JS

I am starting to study Node JS and I am trying to convert an external JSON file to CSV format. The operation that I am trying to achieve is the following: in an internal file I have two urls that lead to an external JSON each (api1 and api2), given…
six
  • 87
  • 1
  • 1
  • 7
0
votes
1 answer

Convert an external JSON to a CSV in Node JS

I am creating a project in Node JS and Typescript in which I want to download a CSV with the information that an API contains in JSON format. Given the url http://localhost:3000/?api=api1, I have to read the JSON related to api1. I have added the…
menphis
  • 85
  • 1
  • 8
0
votes
1 answer

Export the data from a Mongo DB database in a CSV

I have a project in Node JS in which I want to export the data contained in the database in Mongo DB in a CSV file through a button in the view (index.ejs). I am using mongoose for the connection to the database and to export the data to the CSV I…
sharp
  • 7
  • 4
0
votes
1 answer

Proper text encoding pipeline from Javascript object through CSV and up to Azure SQL

Here is a scenario. We are collecting programmatically some data into Javascript object which contain Polish characters. Then we are converting it to string with JSON2CSV library and sending to Azure blob with uploadBlockBlob method from…
0
votes
2 answers

Converting json to csv using json2csv package asynchronously using parseAsync throws error

I am using a json2csv for converting a json response to csv. I need to use this as asynchronous. So that it should not block other api calls. The below code I tried but it throws an error. "TypeError: parseAsync is not a function" const parseAsync =…
user1187
  • 2,116
  • 8
  • 41
  • 74
0
votes
1 answer

How to correctly structure json and configure json2csv to output correct columns and rows?

The data starts off in this shape: [ { date: "July 5, 2020" name: "Calories" symbol: "CALORIES" value: 1,545.2 .., }, { date: "July 7, 2020" name: "Total Carbs (g)" …
lookininward
  • 641
  • 4
  • 25
0
votes
0 answers

when convert to json2csv all headers and datas coming same columns. how can we separate this colums?

I use the json2csv module to convert the data I have to the csv extension and send it by mail, but all the data appears in the same column. What should I do to make it appear in separate columns this is my json2csv.js const {Parser} =…
safa aytan
  • 431
  • 1
  • 6
  • 16
0
votes
1 answer

I want to add the array values to the csv file from mongodb using nodejs

I have the following sample data, [ { "_id": "5e88624da92cf342ac9357a3", "defaultAccountId": 1009, "grnNo": "17 - 20/21", "party": "Adash", "buyer": "Amurtha Knit Lab", "lotNo": "1005", …
naveen
  • 25
  • 7