Reputation: 254
I'm currently trying to read from a CSV files ( separated with semicolon ';') with decimal numbers formatted with a comma(,) as a decimal separator instead of a dot (.).
i.e: the number 12356.12 is stored as 12356,12.
In the source's projection, what would be the correct format to read the value correctly?
The format should in Java Decimal Format
Upvotes: 1
Views: 6345
Reputation: 31
You could always edit the format of the data Type in the Data flow with a Cast activity
Under Cast settings -> edit the format from String to Double
Upvotes: 0
Reputation: 31
True answer is in the comments: In the copy job the culture can be defined, which influences the decimal separator. Go to "mapping" > "Type conversion settings" > "culture" and chose en-us, de-de or whatever works for you. Be aware that this will also influence other types like dates.
Upvotes: 2
Reputation: 23782
If your CSV file's columnDelimiter is a comma (','), your first concern is how to avoid your number data won't be treated as different columns. Since your number data is stored as 12356,12
, so my suggests as below :
|
or other special characters. 2.Set escape char. Please see this description:
In addition, 12356,12 can't be identified as Decimal format in ADF automatically. And no such mechanism o turn ,
into .
. So I think you need to transfer data as string
temporary. Then convert it into Decimal in your destination with java code.
Upvotes: 2