2016-06-15 33 views
0

任何人都可以帮我解决这个案子吗?Talend - 动态列名(企业版)

我有很多文件需要处理,其中两个就像下面的屏幕截图一样我的预期输出为

the screenshot of my file input and my expected output

我用了Talend这种转变:tFileList --- tInputExcel --- tUnpivotRow --- TMAP --- tPostgresqlOutput

输出是我期望的输出不同。这是输出

the screenshot of output of transformation

谁能帮我截图达到我的预期输出这就像我上面第一张图片?

回答

1

这将是非常困难的。您必须将其作为文本文件处理。每当您在第一列中找到“存储”值时,您都会使用该值更新您的类型。

这是我怎么会开始: 基本上tJavaFlex开始部分将包含:

String col1Type 
String colNType 

主要部分:

if input_row.col0.equalsIgnoreCase("store") { 
col1Type = input_row.col1; 
col2Type = input_row.col2; 
colNType = input_row.colN; 
continue; /*(so this record will be Ignored for the rest of the components!)*/ 
} 
output_row.col1Type = col1Type; 
output_row.col1Value = Integer.valueOf(input_row.col1); 
/*coz we have text and need numbers :(*/ 

我想用传播的结果将节省你写下所有其他领域。 从这里开始,它会非常简单,因为您有键类型值类型值类型值结果。