You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2014-04-08 15:56:50

sim82it
Member
14 posts

sim82it said:

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

Offline

#2 2014-04-09 06:44:14

sanvaibhav
Member
1719 posts

sanvaibhav said:

Re: How to "embed" csv file in json

Hi Simon,

Check the screenshot for further details....

Thanks
Vaibhav
mini_132011_csv_json.JPGmini_132011_csv_json_1.JPG

Last edited by sanvaibhav (2014-04-09 06:48:04)


Talend Certified Consultant

Offline

#3 2014-04-15 03:29:59

jjzhou
Talend Team


jjzhou said:

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.

Last edited by jjzhou (2014-04-15 03:31:15)

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy