Question

I am trying to read a CSV file using tFileInputMSDelimited, The CSV file contains numeric values (such as 12 or 12,3)

But when I try to read them as "Double" they are rejected:

For input string: "1 098,00" - Line: 0
For input string: "3,5" - Line: 60
etc...

Integers are read without any problems.

My guess is that Talend is expecting american formated values (1098.00 or 3.5).

How can I configure Talend to work with the french format for numerics (1 098,00 or 3,5)?

I am using Talend V5.4.1

Talend is in english interface (osgi.nl=en)

My computer's locale is France (numbers as 123,45)

Was it helpful?

Solution

You have at least two ways:

  1. If your format is not too exotic (like the case), you can use the advanced separator parameters of tFileInputDelimited. You'll find it as the first advanced parameter. When you activate it, you'll be able to set the separator for thousands and for decimals. As you may see, the default is '.' for decimals and ',' for thousands. tFileDelimitedInput advanced parameters

  2. If your format is very weird, then read the number field as String and convert it to a Double in a tMap in a pure java solution like this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top