Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
SMahadevan1608028474
Contributor
Contributor

Length Check if the number is too long in csv file

I have the source file as .csv with this column Unit Identifier and the actual value contain this column as 100000000000000 (15 is the max length). But in csv the format cells shows as 1.00E+14 (Scientific format cells).

While reading this file in Talend this column reading as String Datatype even output table as well String Datatype.

If the source has 1000000000000001 (16 length) in csv it's appear as 1.00E+15

Here expecting this records should failed in meta data check. I am using SchemaComplianceCheck and Max Length check as well.

 

I have tried  with this statement as well,

 

Source

*********

Unit_Identifier - String

 

In Var

********

(Integer.parseInt(row4.Unit_Identifier)*1) - Datatype Int

 

Output table

****************

Unit Identifier - Int and length (15)

 

The below exception is occurs, Please let me know if any thing wrong here,

 

Exception in component tMap_1 (Datavalidation_Filter_V1_3_tconvertype)

java.lang.NumberFormatException: For input string: "1.00E+14"

 at java.lang.NumberFormatException.forInputString(Unknown Source)

 at java.lang.Integer.parseInt(Unknown Source)

 at java.lang.Integer.parseInt(Unknown Source)

 

But right now it's accepting. How to handle this?

Labels (2)
4 Replies
manodwhb
Creator III
Creator III

@Sathishkumar Mahadevan​ , when you get csv, which you open in excel it will try to read as scientific number,which you need to format in excel and read it .

 

when you open csv file in notepad++ it will properly,so that you will not face these issues.

 

Thanks,

Manohar

SMahadevan1608028474
Contributor
Contributor
Author

Thanks, So are you suggesting to keep the source file as csv same? I have tried to open this csv file in notepad++ as well but still I can see the format as "1.00E+14"

 

My requirement is should handle the various source file type eg: csv, excel, Json, txt as well.

SMahadevan1608028474
Contributor
Contributor
Author

Please can anyone have idea about this length check issue ?

CLi1594691515
Contributor
Contributor

As the result in your CSV is already formatted as scientific number.

Therefore , you need to handle it from the "SOURCE" file which means not display as scientific number.