Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
0683p000009MEX2.png
Labels (2)
4 Replies
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

Thanks for the response!
Im extremely new to talend and java as well so pardon me for any shortcomings i may have 0683p000009MAB6.png
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?
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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