Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

[resolved] Exception in component tFileInputExcel

Highlighted
One Star

[resolved] Exception in component tFileInputExcel

Hi,
I have some difficulties to read an excel file with integer as type. When there is a number with a decimal, the job die on error. I really need to put this data in integer and not in string (to make a proper tcd). The error encountered is :
Exception in component tFileInputExcel_2
java.lang.NumberFormatException: For input string: "7958,6"
    at java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at routines.system.ParserUtils.parseTo_int(ParserUtils.java:105)
    at routines.system.ParserUtils.parseTo_Integer(ParserUtils.java:112)
    at gate.oyak_v2_0_1.OYAK_v2.tFileInputExcel_2Process(OYAK_v2.java:2516)
    at gate.oyak_v2_0_1.OYAK_v2.tSleep_1Process(OYAK_v2.java:847)
    at gate.oyak_v2_0_1.OYAK_v2.tJava_1Process(OYAK_v2.java:745)
    at gate.oyak_v2_0_1.OYAK_v2.tOracleConnection_1Process(OYAK_v2.java:642)
    at gate.oyak_v2_0_1.OYAK_v2.runJobInTOS(OYAK_v2.java:5139)
    at gate.oyak_v2_0_1.OYAK_v2.main(OYAK_v2.java:4968)

Do you have any idea how can I read this file without changing the type of the field in string ?

Accepted Solutions
Highlighted
Seventeen Stars

Re: [resolved] Exception in component tFileInputExcel

The problem is, the component is not very flexible and cannot convert a double into a integer.
The only way is to change the data type to Double and perhaps use the option to change , into .
You can assign without any problems a double to a database column which is actually integer. The database ignores the fragmented part of the number.

View solution in original post


All Replies
Highlighted
Four Stars

Re: [resolved] Exception in component tFileInputExcel

Hi, 
This may help..  There is an 'advanced separator (for numbers)' option that gives the ability to identify the decimal separator and the thousands separator in the Advanced Settings tab. 
Highlighted
One Star

Re: [resolved] Exception in component tFileInputExcel

Yeah I already tried that but the error is the same
Highlighted
Seventeen Stars

Re: [resolved] Exception in component tFileInputExcel

The problem is, the component is not very flexible and cannot convert a double into a integer.
The only way is to change the data type to Double and perhaps use the option to change , into .
You can assign without any problems a double to a database column which is actually integer. The database ignores the fragmented part of the number.

View solution in original post

Highlighted
One Star

Re: [resolved] Exception in component tFileInputExcel

Great it's working with the double type
Thx a lot jlolling

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog