Skip navigation

Decimal value in CSV file

767 Views 3 Replies Latest reply: Apr 23, 2011 1:58 AM by KOENIG Yvan RSS
Serge Dufort1 Level 1 Level 1 (5 points)
Currently Being Moderated
Apr 19, 2011 2:44 PM

Hello everyone,

it is my first post here.

I'm trying to import a CSV file into Numbers, but the result is not quite what I was looking for. First of all, to get Numbers to open the file I had to drag and drop it into Numbers, I didn't find any other way to do it. I was looking for an "import" button that would let me give some kind of instructions on how to open the file, but did not find this button.

In the CSV file, every numbers is separated by a comma, wich is normal, but the decimal portion of a value is also indicated by a comma and when imported it ends up in it's own column. So 4,5 might be 2 columns, the first one with the value 4 and the second one with the value 5, but 4,5 could also be the value 4,5. How do we tell Numbers how it should interpret the different values in a CSV file. Is it possible to say that column 4 is in fact the decimal part of value in column 3?

Hopefully this is clear enough for you to understand.

Thank you for your help.

  • Level 8 Level 8 (41,760 points)
    Currently Being Moderated
    Apr 22, 2011 2:04 AM (in response to Serge Dufort1)

    Hello

    The support of CSV files was described here many times.

     

    If the decimal separator in use on the system is the period, Numbers requires the original CSV format : Comma Separated Values.

    If the decimal separator in use on the system is the comma, Numbers requires the alternate CSV format : Semi-colon Separated Values.

     

    Given what you wrote, you are trying to import datas from a file using the original CSV format and the decimal comma.

     

    I know that some experts wrote Python filters to treat such case but I have no reference available at this time.

     

    If you send a sample file to my mailbox, I will try to write an AppleScript deciphering it.

    But as I often wrote, CSV is really the worst format ever invented. Why aren't you asking the document's author to use Tab Separated Values format ?

     

    Click my blue name to get my address.

     

    Yvan KOENIG (VALLAURIS, France) vendredi 22 avril 2011 11:04:21

  • Level 8 Level 8 (41,760 points)
    Currently Being Moderated
    Apr 23, 2011 1:58 AM (in response to Serge Dufort1)

    The standard CSV format may be used when the decimal separator is the comma.

    It requires that numerical values are enclosed between quotes.

     

    It's what Numbers '08 was deciphering.

     

    Alas, at this time, Claris which is a 100% Apple subsidiary delivered Bentoy (no typo here, the "y" is deliberate) which used the alternate format.

     

    I filed a report and Apple changed the app behavior/requirements when they designed Numbers '09.

    There is no perfect solace with this ridiculous format.

    In lieu of editing your encoding scheme from comma to semi-colon, it would have been more efficient to replace the comma separator by the TAB, name the exported files as wxyz.txt and you would have a clean answer.

     

    Yvan KOENIG (VALLAURIS, France) samedi 23 avril 2011 10:58:05

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.