tLoop on a tFileInputDelimited : loop number of rows

One Star

tLoop on a tFileInputDelimited : loop number of rows

Hello
I put a tLoop on a tFileInputDelimited component in order to loop on it. For the tLoop component, there is a "to" param to define (default value : 10). If I have a non deterministic number of row in the tFileInputDelimited, how can I define the "to" param of tLoop in order to loop at least the number of the row that we have in the file?
thks
Valery
One Star

Re: tLoop on a tFileInputDelimited : loop number of rows

Hi,
Use tFileProperties to find the number of rows in your file.
Good luck
One Star

Re: tLoop on a tFileInputDelimited : loop number of rows

Hi,
Not sure what you are trying to do here. The file gets read row by row for all rows in it, you don't need a loop there. Can you explain the need for the loop?
Regards,
Arno
One Star

Re: tLoop on a tFileInputDelimited : loop number of rows

Correct Arno, I did not understand why at the begin. Effetively tFileInputDelimited read row by row.
but in http://www.talendforge.org/forum/viewtopic.php?id=22333 they are using it. I don't really understand why but it runs.
Valery
One Star

Re: tLoop on a tFileInputDelimited : loop number of rows

Okay, in case you want to add rows like in that case I get it.
Using tFileProperties, like saukema suggested, is the correct solution i suppose.
Regards,
Arno
One Star

Re: tLoop on a tFileInputDelimited : loop number of rows

Arno,
If you get it, could you explain it me brievely?
thks
Valery
One Star

Re: tLoop on a tFileInputDelimited : loop number of rows

unfortunately ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) is null when I am launching the job. Any idea?
Valery
One Star

Re: tLoop on a tFileInputDelimited : loop number of rows

Hi Valery,
Still unsure about what you are trying to achieve here. Do you just want to replicate what's done in the other thread, or do you have a need to insert empty rows?
Regards,
Arno
One Star

Re: tLoop on a tFileInputDelimited : loop number of rows

Hello
Insert an empty row
Valery