Five Stars

how to read the numeric data from a tfileInputExcel component column. the column contains string as well as numbers

hi, 

i want to read the numerical data from the input column of an excel file. the column contains String data as well as Numerical data. i am not able to do this. please help me hoe to do this. I want to print the numerical data in a table format.

 

Thanks & Regards

Mastan

4 REPLIES
Thirteen Stars TRF
Thirteen Stars

Re: how to read the numeric data from a tfileInputExcel component column. the column contains string as well as numbers

Hi,

Define the input field as String datatype, then use a common Java conversion method to convert to the expected output format (Integer, Float, BigDecimal, ...).

You can define your own conversion method using a routine or if you don't have to reuse it elsewhere, you can do it using a single tJavaRow component.

Google will help you to find the desired conversoin Java code.


TRF
Five Stars

Re: how to read the numeric data from a tfileInputExcel component column. the column contains string as well as numbers

Hi,

Thanks for your reply can you please share the sample job design for this, bcz i ma new to talend i wrote the code to catch the numeric data from the text file but it is not working in talend environment. my tjavarow code is

1.png

Thanks & Regards

mastan

Thirteen Stars TRF
Thirteen Stars

Re: how to read the numeric data from a tfileInputExcel component column. the column contains string as well as numbers

General design should be like this:

tFileInputExcel-->tJavaRow (or tMap)-->tLogRow (or anything else)

In tJavaRow you'll get row 1 by 1 from Excel file so you just have to operate the conversion.

This link may help as an example https://www.talendforge.org/forum/viewtopic.php?id=16475 but you can find many others from Google.


TRF
Five Stars

Re: how to read the numeric data from a tfileInputExcel component column. the column contains string as well as numbers

Hi, 

thanks for your quick reply, but actually my requirement is capturing the numerical data from the input field. but the input field having the text and numeric data combined like the text file..i as sending the sample input and output pics..

Sample Output:4.pngpharma2.png

Sample Input:

2.png3.png

Please tell me one solution to achieve this output.

 

Thanks & Regards

Mastanaiah Shaik