【问题标题】:How to make multiple rows from one row in Talend?如何在 Talend 中从一行中创建多行?
【发布时间】:2020-12-28 21:38:56
【问题描述】:

我的数据如下所示:

Name | Address | FormName
John | 123 Apple Drive | Form1 Form2 Form3
Dave| 133 Westchester Drive | Form1 Form2 Form3

如何根据 FormName 列将其转换为多行?所以结果是:

Name | Address | FormName
John | 123 Apple Drive | Form1
John | 123 Apple Drive | Form2
John | 123 Apple Drive | Form3
Dave| 133 Westchester Drive | Form1 
Dave| 133 Westchester Drive | Form2
Dave| 133 Westchester Drive | Form3

因此为每个人的每个表单创建了一行。

我尝试使用 tJavaFlex 组件,但这对于这个简单的任务来说似乎太复杂了。

【问题讨论】:

    标签: talend talend-mdm


    【解决方案1】:

    我发现tNormalize 正是这样做的!我将tNormalize 连接到我的tMap,如下所示:

    tNormalize 组件中,我指定了我想要分隔的内容(空格)以及规范化的列

    【讨论】:

      【解决方案2】:

      一种方法:

      1. 循环遍历数据集中的每一行。

      1.1。将姓名和地址放入“当前人员”字符串中。

      1.2。当你到达表单“字段”时,解析它。

      1.2.1。对于表单域中的每个表单

      1.2.2。打印(添加到向量等)“当前人”+“当前形式” - 连接。

      这是一种非常基本、直接的方法,因此请先了解它的工作原理,然后再考虑其他方法 - 如果有的话。

      【讨论】:

        猜你喜欢
        • 2023-02-02
        • 1970-01-01
        • 2013-01-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多