I created this to scratch an itch of mine when reading a csv file into Numbers that contained commas. It turned out that Numbers puts each line into a single cell. It ignores the commas. And there’s no way to specify that the delimiter needs to be a comma, not a semi-colon.
Here’s a small tool made using a small python script and Platypus that will launch as a ‘droplet’ and will allow you to drop a csv file on it that has COMMA (meaning this , ) separated values.
It will accept any csv file and convert from commas (,) to semi-colons (;) and save the result out again as “filename2.csv” – Numbers should be able to open it correctly then. Your original csv file is only read.
Please note that commas inside double quotes are preserved and not converted.
It works on my smallish csv files, but please note :
! WARNING ! THERE ARE NO GUARANTEES THAT THIS WILL WORK FOR YOU – YMMV ! WARNING !
Please note there is NO feedback if something goes wrong.
It works on my 2 macs (using OS X Mavericks), so I figured I would throw it out in the wild for those people who also might need it.
You can download the (non-signed) app here : Com2DotCom.app – you’ll need to open it using RIGHT-CLICKING on the App the first time.
Feedback, comments, bug reports, etc are very welcome. If possible, I’ll try to respond and help you out.
35 replies on “Importing a comma-separated csv file into Numbers Tool”
Thanks, you save my day!
You’re very welcome ! 🙂
Thanks!
Just save me some unnecessary headache in this tax period
You just saved my day.
Hey Rob, thanks – glad I could help. I read your blog, interessante artikels. Groetjes, Alex.
You’re great!
Thanks for this app. Really help me!
Thanks!
Numbers 3 removed the possibility to drag a csv file to an empty document. Your app saved me!
Funziona, molto bene e molto utile
Thanks!
It is really helpfull!
You saved me having to go through excel and back.
Thanks a lot!
Let me know if there are things that can be improved, thanks !
¡Gracias!
Great!
It worked perfectly in Yosemite.
Greetings from Portugal and Happy New Year !!
You saved my day! Do you know of a way to make Numbers export comma separated .csv files correctly?
Hello Tina,
As far I can find, there are no options in Numbers to export to CSV files with a comma instead of a dot-comma as a seperator.
If the data is not too complicated (meaning it contains complex uTF-8 characters), I could probably write you a very quick and dirty python script that will do the reverse : take all the ; and replace them with just commas. Just the reverse of what the script now does, in fact.
Do you have any experience with python scripts ? If not I’ll see if I can create another drop thingy, but it’ll take some more time and that depends a bit on when I have some free time to work on it…
The best thing would be if you could post or send me a few sample lines of what you want to convert though… (nothing secret, but similar to what you want converted). That way I can use that as a test.
Alex
you are my hero of the day
Thanks very much for Comma2DotComma.
Works great !
Thanks a lot!!!
Thank you very much!! Works perfect!
You are the Best! Thank you very much for your help!
Thanks you for this app.
It works with smaller files. No I want to try it with a file of 900 ‘lines’ but I don’t get a result. Is there a max?
It should work, there is no max lines programmed into it. But if your file is not correctly formatted, it fails silently. Let me know if you need some more help.
Works perfectly! Thank you so much for your time and effort in making this-
Hi Rob,
the line
global header
and the comment line preceding it, appear unneeded. And a typo: garanties -> guarantees.
It would be nice to state that comma’s encapsulated within the field delimiters (double quotes in my case) are preserved. So in these case the comma’s are not treated as field separators, but as actual cell content!
So the lines
"a, b, and c","d, e","f"
"klm","xyz","Rob's test"
results in
a, b, and c;d, e;f
klm;xyz;Rob's test
giving a 2×3 table.
Sorry, I meant to write Alex, not Rob, to address you!
No worries Roger ! Though I was a bit confused at first. With the global header are you talking about the actual code I wrote ? That was a quick script… I’m sure there are other mistakes in there.
As for the commas that are preserved inside the field delimiters: I’ll add it to the description.
Best shit ever!
Too bad it did not work for me :-/
If you can supply me with some more info, perhaps I can help you solve the problem…
it worked so easily..
It just needs to rename the file or create a copy so that you know it has actually done something!
Actually, it should rename the filename to filename2 – the program only *reads* the original file, never writes to it.
Changing Mac OSX System Preferences > Language & Region > Advanced > Number Separators-Decimal and Currency-Decimal from a comma to a dot resolves the issue for me.
@Chas,
be careful: for numbers or amounts larger than 1000 your fix will probably break.
THANK YOU SO MUCH!!!
You saved my day and what was left of my sanity!!