Issue with Iterating through tFileInputExcel

One Star

Issue with Iterating through tFileInputExcel

Hey All,
So i'm having a bit of trouble with a job. I've currently got a process that extracts data from a number of excel pages, then packages that data as csv files and creates archives of them and the original document. My issue is with the extraction portion. As of right now, I am iterating a number of files to have the data extracted and all of these files are going through and being changed into csv files successfully. The issue is that the data is only extracted from the first file and this data is put into all of the csv files that are created. For example I have Files 1 2 3 and 4 going through the process. I end up with csv files for all of them, however the data in these csv files is only the data from file 1. I've included a screenshot of my job below. The rest of the job is working fine it is only this issue with the data extraction. Any help would be much appreciated!
Thanks,
Ryan
Community Manager

Re: Issue with Iterating through tFileInputExcel

Hi
I think there must be something wrong in the job design, what does the tJavaRow do in the job? Some screenshots of tFileInputExcel, tJavaRow, tFileFixedFlow and tFileOutputDelimtied component will be helpful for us to understand the problem.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Issue with Iterating through tFileInputExcel

Hi,
The tJavaRow defines which cells are being extracted. I've added some screenshots of the other parts.
Seven Stars

Re: Issue with Iterating through tFileInputExcel

The problem is that your sequence is not being restarted for each file so, if the first file contains 100 rows, seq is 101 for the first row of the second file.
There are two ways to fix it:
1. Use the tFileList file name or number as the sequence name (instead of "s1") so each file has its own sequence; or
2. Add a tJava between tFileList and tFileInputExcel where you can call Numeric.resetSequence or Numeric.removeSequence to restart the sequence "s1".
One Star

Re: Issue with Iterating through tFileInputExcel

Awesome thanks for the reply! I'm rather new to this so I'm going to request a little more help. The second option sounds like the best route for me to take. Could you possibly further explain how i would go about doing what you suggested? Thanks again for the help!
One Star

Re: Issue with Iterating through tFileInputExcel

I guess what I'm asking is how i would use the tJava itself as I've never used this particular component before. Thanks ahead of time!
Seven Stars

Re: Issue with Iterating through tFileInputExcel

tJava just executes whatever code you put in it but it's intended to be used as a stand-alone subjob not in a flow. In you case, just put in either:
Numeric.resetSequence("s1",0);
--or--
Numeric.removeSequence("s1");
One Star

Re: Issue with Iterating through tFileInputExcel

Awesome it worked great! Thanks a ton for your help!