Extracting specific data from a cell in excel

One Star

Extracting specific data from a cell in excel

Hi,
I'm currently working on a job to extract data from 9 cells in an excel document. Everything has worked well so far and the numbers are being extracted except for a small snag. There is one cell that has letters as well. If possible id like to be able to remove these letters and keep just the numbers. I've included a screenshot of the process I'm using as well as the results below that. The part underlined in red is what I'd like to remove. Any help would be much appreciated!
Thanks
Seventeen Stars

Re: Extracting specific data from a cell in excel

I would read the cell at first as String value from Excel and if the value you showed us has always the same prefix:
Integer.parseInt(row1.my_cell.substring(8)) and convert it to a integer.
One Star

Re: Extracting specific data from a cell in excel

Thanks for the response!
Im extremely new to talend and java as well so pardon me for any shortcomings i may have Smiley Tongue
where exactly would i put your code? should i plug that into the main code section? or is there somewhere specific i need to put it?
Seventeen Stars

Re: Extracting specific data from a cell in excel

I would use it in tJavaRow_1.
I do not know exactly your code but I guess you write your value into a context variable of type Integer.
This scenario would looks like:
context.myValue = Integer.parseInt(row1.my_cell.substring(8));
and you use your context variable in the tFixFlow.
One Star

Re: Extracting specific data from a cell in excel

Awesome! You've been really helpful thanks a ton for the assistance!