简体   繁体   English

Talend ETL 将 Excel 转换为 JSON

[英]Talend ETL Converting Excel to JSON

I would like to convert below Excel to JSON Format.我想将下面的 Excel 转换为 JSON 格式。 Could you please help能否请你帮忙

在此处输入图像描述

Required JSON Format需要 JSON 格式

[ { "name": "Basil", "id": 1, "report": [ { "subject": "Maths", "exams": [ { "semister": 1, "mark": 20 }, { "semister": 2, "mark": 21 }, { "semister": 3, "mark": 22 } ] }, { "subject": "Physics", "exams": [ { "semister": 1, "mark": 41 }, { "semister": 2, "mark": 44 }, { "semister": 3, "mark": 45 } ] } ] } ] [ { "name": "Basil", "id": 1, "report": [ { "subject": "数学", "exams": [ { "semister": 1, "mark": 20 }, { “学期”:2,“标记”:21 },{“学期”:3,“标记”:22 }]},{“主题”:“物理”,“考试”:[{“学期”:1, "mark": 41 }, { "semister": 2, "mark": 44 }, { "semister": 3, "mark": 45 } } ] } ]

  • Save your "required JSON Format" as a json example file.将“所需的 JSON 格式”另存为 json 示例文件。
  • In talend, go to "Metadata" section (in repository), then "Create JSON File".在 talend 中,go 到“元数据”部分(在存储库中),然后是“创建 JSON 文件”。
  • Select "output schema", then select your example file as a source file. Select “输出模式”,然后 select 您的示例文件作为源文件。
  • Check the mapping proposed by Talend, add Loops (on exam i think)检查 Talend 提出的映射,添加循环(我认为在考试中)
  • When done, use a tWriteJsonField component with your freshly created metadata as an output, input should be your tFileInputExcel --> tMap.完成后,使用 tWriteJsonField 组件和新创建的元数据作为 output,输入应该是您的 tFileInputExcel --> tMap。
  • Map columns from your excel file to your output in tMap Map 列从 excel 文件到 tMap 中的 output

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM