2016-06-15 34 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 :(*/ 

我想用傳播的結果將節省你寫下所有其他領域。 從這裏開始,它會非常簡單,因爲您有鍵類型值類型值類型值結果。