[resolved] How to extract specific cell from multiple excel in a folder

One Star

[resolved] How to extract specific cell from multiple excel in a folder

Hye, 
I need to extract specific cell from multiple excel in a folder.
But, I have a problem which is the output is repeated. 
How to solve the problem? Here, i attached the screenshot what im used to show the output.

Accepted Solutions
Seventeen Stars

Re: [resolved] How to extract specific cell from multiple excel in a folder

At first you do not reset the sequence, means every file the sequence value will grow.
Next you write the context variables once but never again, because of that you will always get the same value.
To get an idea what I mean I suggest you set null the values before you set the values, you will see you get mostly null values instead of always the same value.
I would use a tJavaFlex instead of tJavaRow and reset the sequence in the begin part or use simply the file name as name for the sequence.

All Replies
Seventeen Stars

Re: [resolved] How to extract specific cell from multiple excel in a folder

The resolution of your screenshot is to low to spot anything on it.
What do you mean with "The output is repeated". The tFileInputExcel component is fairly simple and start reading from the start row until the last row and starts with the start column until the last schema column is reached.
To get one value you have to specify one schema column and setup the start and end row according to your needed position.
If you find that a bit cumbersome (me too) you could try the alternative Excel component tFileExcelReferencedCellInput. This component can read a particular cell addressed by row/col or the Excel address expression "D1" on a specific sheet.
One Star

Re: [resolved] How to extract specific cell from multiple excel in a folder

The output is repeated means I have input from multiple excel in a folder, when run the job execution the output read from the first excel only... so, all the output are same..
Four Stars

Re: [resolved] How to extract specific cell from multiple excel in a folder

Hi,
Can you show the settings for your excel component?
vaibhav
One Star

Re: [resolved] How to extract specific cell from multiple excel in a folder

Hi, here attached the setting tfileinputexcel..TQ
Seventeen Stars

Re: [resolved] How to extract specific cell from multiple excel in a folder

hi,
sorry but we still not seeing your screenshoot clear enought.
regards
One Star

Re: [resolved] How to extract specific cell from multiple excel in a folder

sorii..here, there is new attachment for your reference.... 
Four Stars

Re: [resolved] How to extract specific cell from multiple excel in a folder

Hi,
Suppose you want to read cell on 5th row and 3rd column then you can set following properties in your tFileInputExcel component
- Set header - 4
- Start column position - 3
- End column position - 3
- Set Limit to - 5
Try above... while doing so you will get an idea.
Thanks
Vaibhav
Seventeen Stars

Re: [resolved] How to extract specific cell from multiple excel in a folder

The reason for getting always the same values must be in the tJavaRow. You design to iterate through the files with tFileList and read every file with tFileInputExcel is fine and should work.
For us between the reading from the excel file and the log output there are a lot of not visible steps and I am sure you will find here the problem. If you need held, please tell us what you do in the tJavaRow and the tFixedFlowInput.
One Star

Re: [resolved] How to extract specific cell from multiple excel in a folder

Hi, jlolling...
Here, there is new attachment for reference.. Example, I want to get source from B4, B5 and J1..TQ...
One Star

Re: [resolved] How to extract specific cell from multiple excel in a folder

Hi,
Can anyone give me some suggesstion how to solve the problem... pleasee advice me... TQ...
Seventeen Stars

Re: [resolved] How to extract specific cell from multiple excel in a folder

At first you do not reset the sequence, means every file the sequence value will grow.
Next you write the context variables once but never again, because of that you will always get the same value.
To get an idea what I mean I suggest you set null the values before you set the values, you will see you get mostly null values instead of always the same value.
I would use a tJavaFlex instead of tJavaRow and reset the sequence in the begin part or use simply the file name as name for the sequence.
One Star

Re: [resolved] How to extract specific cell from multiple excel in a folder

What do you meant set null the values before set the values? Can you give me some examples how to set the null value?
Can we set the null value in tJavarow?
One Star

Re: [resolved] How to extract specific cell from multiple excel in a folder

Mr. Jlolling, 
How to use tJavaFlex? Can you give me some example how to set in tJavaFlex? Example, i want to extract specific data from D1, J1, and B3 in excel file...
Did i should replace tJavaRow with tJavaFlex in my job design... it is right? TQ
Seventeen Stars

Re: [resolved] How to extract specific cell from multiple excel in a folder

Hey, it is your Java code and this has nothing to do with Talend. 
I would simply implement my last suggestion and use the file name as name for the sequence
Instead of "s1" use ((String)globalMap.get("tFileList_1_CURRENTFILE")).
This way you start a new sequence for a new file and the you will get the values always from the right number of rows.
One Star

Re: [resolved] How to extract specific cell from multiple excel in a folder

tQ so muchhh..... i have successfully completed... =)