New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Talend Data-Integration-Developer Exam - Topic 5 Question 50 Discussion

Actual exam question for Talend's Data-Integration-Developer exam
Question #: 50
Topic #: 5
[All Data-Integration-Developer Questions]

You need to calculate the total number of rows in an input file using a tMlelnputDelimited component.

Which code should you use in a tJava component to write a nb-line variable?

Show Suggested Answer Hide Answer
Suggested Answer: C

You need to use the following code in a tJava component to write a nb_line variable:

int nb_line = (Integer)globalMap.get(''tFileInputDelimited_1_NB_LINE'');

This code retrieves the value of the global variable tFileInputDelimited_1_NB_LINE, which stores the number of rows processed by the tFileInputDelimited component, and assigns it to an integer variable named nb_line. You can then use this variable to print or manipulate the number of rows in your Job. Note that you need to use globalMap.get, not globalMap.put, to access the value of a global variable.


Contribute your Thoughts:

0/2000 characters
Pa
5 days ago
I remember practicing a similar question where we had to use a tJava component to manipulate data, but I can't recall the specific code for nb-line.
upvoted 0 times
...
Julene
10 days ago
I think we need to use a method to read the file and count the lines, but I'm not sure about the exact syntax.
upvoted 0 times
...
Joni
15 days ago
No problem, I've done something like this before. In the tJava component, I'll use a simple loop to count the rows as I read through the file with tMlelnputDelimited, then set the nb-line variable at the end.
upvoted 0 times
...
Fausto
20 days ago
This is a tricky one. I'm not sure if I should be using a tJava component or if there's a more direct way to get the row count in Talend. I'll need to experiment a bit.
upvoted 0 times
...
Glory
25 days ago
Okay, I think I've got a strategy for this. I'll use the tMlelnputDelimited component to read the input file, then in the tJava component I'll count the number of rows and assign that to the nb-line variable.
upvoted 0 times
...
Alisha
1 month ago
I'm a bit confused on how to write the code in a tJava component to set the nb-line variable. I'll need to review the Talend documentation carefully.
upvoted 0 times
...
Thea
1 month ago
Hmm, this seems straightforward. I'd probably start by looking at the tMlelnputDelimited component documentation to see how to get the total number of rows.
upvoted 0 times
...

Save Cancel