Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am new in the Talend and trying below scenario.
Scenario:
Read CSV file and after reading the file print number of lines in the file. Output in console. Should be done in 3 components.
for this I am using below components:
tFileInputDelimited --> tFileRowCount --> tFileOutputDelimited
Output in console:
getting rows but no count at the end.
Can anyone help me to sort out this issue.
Thank you!
Hi,
As you're reading in the file in the tFileInputDelimted component, after the output, you can get the row count by querying the NB_LINES component variable for either the input or output components , connect a tJava AFTER both with an "OnSubjobOK" and you should have access to it.
Hi
tFileRowCount - independent component and really not needed in this chain
you just need add tJava (OnSubJobOk or OnComponentOk) with code:
System.out.println(((Integer)globalMap.get("tFileOutputDelimited_1_NB_LINE")));same for tFileInputDelimited (good if used filter - count IN - count Out)
Thank you Guys! I got the number of lines in the console.