06-11-2020 06:22 AM
Hello All,
I’m trying to Conver a CSV file to a JSON Format. Can anyone provide some inputs on how to achieve the required output format into a mapper?
Required Format:
{
“values”: [
[
“Row1-Column1 Data”,
“Row1-Column2 Data”
],
[
“Row2-Column1 Data”,
“Row2-Column2 Data”
]
]
}
Thanks,
Sasank
Solved! Go to Solution.
06-11-2020 08:52 AM
Hello @skodali
I tested a bit with your issue and come up with some solution. Please check this pipeline and the csv test file, and see if that can help you.
test2_2020_06_12.slp (8.8 KB)
and csv file structured like screenshot bellow
BR
Dimche Saveski
06-12-2020 02:02 AM
N number or rows should be bigger than number of expected input records. If you expecting 100 records , set that number 700 , just to be on the safe side.
P.s Updated the pipeline and the file
BR
06-12-2020 11:46 AM
@dimche.saveski
Updated pipeline is resulting in different structure compared to the required format.
06-12-2020 12:07 PM
I’ve tried to achieve structure like your original post requirements, on the left is result on the right requirements:
Maybe you like to achhieve Row1 : Column1 key value pairs?
BR
06-12-2020 01:02 PM
Updated pipeline almost resulted the desired format but “values” should not be the target path. Values text should be part of JSON like:
Pipeline results were like:
06-12-2020 01:08 PM
Just add “requiredResult” before the “values” field in the last mapper of the pipeline, like this