Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone
I have two JSON questions.
Consider below input JSON fragment coming from JSON Input File:
"source":{
other JSON fields here ....
"NetworkIdList":["networkdevice_1","networkdevice_2","networkdevice_3"],
"KeyValuePairs":{"Gearbox":"Automatic","Drive":"FrontWheelDrive","BodyStyle":"SUV","Make":"Mitsubishi"},
other JSON fields here ....
}
The JSON is in BOLD font.
Q(1) simple array extraction (no sub-fields inside array elements)
Q(2) Key-Value-Pair extraction
Output desired: for JSON simple array marked as Q(1)
NetworkID:
networkdevice_1
networkdevice_2
networkdevice_3
---------------------------------------------
Output Desired: for JSON key-value-pair Q(2)
Key Value:
Gearbox Automatic
Drive FrontWheelDrive
BodyStyle SUV
Make Mitsubishi
Please give me some hints how I can do this inside Talend DI job.
I am willing to write some Java if it helps me to solve this problem.
Thanks in advance
Hi Yuri
1.for extracting simple array you can configure the input json as following image and use tnormalize component to split the rows
tfileinputjson-->tnormalize-->tlogrow