Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team, I want to divide 10 in ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) record count and split 10 files in the tFileOutputDelimited output
Hi
The global variable ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) can be only used in next subjob, you can't used it directly in the current subjob, so I suggest you to use tFileRowCount to get the number of total rows of file first, and calculate the number of rows of each file if you need to split the output to several files. eg:
tFileRowCount_1
|onsubjobok
tJava
|onsubjobok
tFileInputDelimited--main-->tFileOutputDelimited
on tJava:'
int total_nb_line=((Integer)globalMap.get("tFileRowCount_1_COUNT"));
int each_file_rows=total_nb_line/10+1;
globalMap.put("keyName",each_file_rows);
In the advanced settings panel of tFileOutputDelimited, check the 'Split output in several files' and set the parameter of Rows in each output file as:
(Integer)globalMap.get("keyName")
Hope it helps you!
Regards
Shong