How to "embed" csv file in json

Highlighted
One Star

How to "embed" csv file in json

Hi all,
i have a csv like this :
Id,name,lastname,trainingCode,trainingCost
1,Simon,Tod,AX2,2345
I need a json output like this :
Employee : {
"id" : 1,
"name" : "Simon" ,
"lastname" : "Tod",
"training" : {
"trainingCode" : "AX2",
"trainingCost" : 2345
}
}

How can i do it?
tyvm
Simone
Highlighted
Four Stars

Re: How to "embed" csv file in json

Hi Simon,
Check the screenshot for further details....
Thanks
Vaibhav
Highlighted
Employee

Re: How to "embed" csv file in json

If you already has value like this: "{"employee":{"id":"1","name":"Simon","lastname":"Tod","training":{"trainingCode":"AX2","trainingCost":"2345"}}}" ,after tWriteJSONField component,connect a tFileOutPutDelimited component(don't connect tFileOutputJSON component after tWriteJOSNField),then you can get your expect json file.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog