Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Unable to get the row count

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!

Labels (3)
3 Replies
David_Beaty
Specialist
Specialist

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.

 

vapukov
Master II
Master II

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)

Anonymous
Not applicable
Author

Thank you Guys! I got the number of lines in the console.