Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Importing CSV file as Data Source. Problem with numeric fileds in Spanish format.

  1. #1
    Join Date
    Apr 2014
    Posts
    3

    Question Importing CSV file as Data Source. Problem with numeric fileds in Spanish format.

    Hi everybody!

    I'm trying to create a "New Datasource" from CSV file. I use “Data Source Wizard” .
    1. In the first step, I select "Source Type = CSV File"
    2. In the second step, I have to specify the format of numeric fields. I have a Spanish format file with numeric fields like that (1.111,22).
    That means we have "," instead the "." for decimals, and "." instead of "," for miles. Well, I haven't choosen the value from the combo (all are "English format") and I typed my own format "#.##0,##" or "#.###,##".
    It doesn't work, i have an exception like that:
    “Couldn’t convert String to a number.”
    “Not numeric character found at position 2”
    “Malformed pattern”

    However, the simple option "#,#" works, it confuses me...

    Of course, I know i could use "spoon" or excel to change numeric formats before importing them, but I would know if there is a bug or limitation, or it's me (I'm doing something wrong).

    Any idea will be welcomed :-)
    Thanks in advance,
    Natalia

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    I'm way too late, but you don't use your local symbols for the format string.
    Always use the decimal point to indicate a decimal point.
    Let your locale provide the actual symbol to use as a decimal point when parsing or formatting your numbers.
    Or specify the symbol in the field metadata, if you must, but never ever in the format string.
    So long, and thanks for all the fish.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.