Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
@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
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.
Please can anyone have idea about this length check issue ?
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.