Questions tagged [csvtojson]

101 questions
0
votes
1 answer

Split json value to Array of Strings

I have a code which converts CSV File to JSON String public static Optional csvToJSON(String filePath) { try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), …
user1233
  • 5
  • 1
  • 3
0
votes
1 answer

Difficulty using csvtojson to create nested JSON structure from csv

There's a feature in the csvtojson package where you can create a nested JSON object from a CSV file permitting you configure the headers correctly. However, I'm having difficulty applying the schema shown in the above link for my CSV file. My…
sxmrxzxr
  • 41
  • 1
  • 8
0
votes
1 answer

Complex JSON object from CSV String in Python

I want the below JSON output after parsing csv string in Python to feed API: { "_records":[ { "_fields":{ "Account":"DSP2", "Code":"11" } }, { "_fields":{ …
Ankit Singh
  • 57
  • 1
  • 3
0
votes
1 answer

Playwright Typescript how to convert a CSV file in to JSON object and use that data in Script to perform data driven testing

I have a scenario where i have to convert a csv file in to JSON object and use the data in script for performing data driven testing. If the file has multiple rows of data, then script should be executed for multiple iterations. Csv…
Prasad
  • 119
  • 1
  • 5
  • 13
0
votes
2 answers

Retrieve JSON from CSV using python in desired format

Many thanks in advance, I have been keen on collecting some insights on getting the below output from its corresponding input. Would like to see the table getting converted to a desirable format via using a python script as I have to work with a…
Prasad
  • 5
  • 2
0
votes
1 answer

Creating individual JSON files from a CSV file that is already in JSON format

I have JSON data in a CVS file that I need to break apart into seperate JSON files. The data looks like this: {"EventMode":"","CalculateTax":"Y",.... There are multiple rows of this and I want each row to be a separate JSON file. I have used…
0
votes
0 answers

How to build custom format JSON using node csv to json?

CSV: TableName, RowCount, TableStatus table1, 10, Y table2, 21, N table3, 23, Y table4, 24, N table5, 25, Y Need to convert CSV to JSON in this format: { "table1": { "row_count": "10" } }, { "table3": { "row_count":…
hardcode
  • 395
  • 3
  • 19
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
2 answers

Java8 convert csv to json object

i am comparing two json objects, one of them get request and other input from csv file --- for the csv to json logic -- following code, csv file looks like this ---- the csv file looks like this - sw product,sw product module,technology Product…
Indranil
  • 3
  • 4
0
votes
2 answers

Express & csvtojson: "Unhandled rejection Error [ERR_STREAM_WRITE_AFTER_END]: write after end"

I am trying to get the data from a csv-file as a json-object on my server: const express = require('express'); const router = express.Router(); const csv = require('csvtojson'); const converter = csv({ noheader: true, delimiter: ',', …
0
votes
2 answers

How can I make JSON file from a CSV?

I have a CSV file with 4 columns(A, B, C, D). Like this: A B C D Example english text Translated text Context Max Length Example english text 2 Translated text 2 Context 2 Max Length 2 Example english text 3 Translated text 3 Context…
Balla Botond
  • 55
  • 11
0
votes
0 answers

Converting csv to json using smooks

I am converting csv to json using smooks. Output file is coming as expected but there is one trailing comma in last csv-record. In the end output is coming as this },] which will be invalid json format. If I used selector as #document and use if to…
S317
  • 29
  • 1
  • 5
0
votes
1 answer

Mongoose import data from csv only inserting partial data

I am new to MongoDB and Node.js and I am facing an issue while saving data into MongoDB Atlas from a .csv file through mongoose. I want the .csv file to be uploaded by a user through file input and then insert the data in this .csv to MongoDB Atlas.…
0
votes
1 answer

Read CSV over SSH and convert to JSON

This is a duplicate of this question here Here is the code I'm trying to work with: let Client = require('ssh2-sftp-client'); let sftp = new Client(); var csv = require("csvtojson"); sftp.connect({ host: 'HOST', port: 'PORT', username:…
Jim Dover
  • 593
  • 2
  • 12
  • 30
0
votes
1 answer

Formatting of JSON file

Can we convert the highlighted INTEGER values to STRING value (refer below link)? https://i.stack.imgur.com/3JbLQ.png CODE filename = "newsample2.csv" jsonFileName = "myjson2.json" import pandas as pd df = pd.read_csv…
imkanishks
  • 11
  • 1