Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Decimal value in CSV file

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.

Posted on Apr 19, 2011 2:44 PM

Reply
Question marked as Best reply

Posted on Apr 22, 2011 2:04 AM

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

3 replies
Question marked as Best reply

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

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

Decimal value in CSV file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.