Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening csv files in MicroSoft Excel on a mac

Tags:

macos

csv

excel

I am having trouble opening csv files correctly in Microsoft Excel for Mac 2011, Version 14.1.0. The files will open but the dialog box to set the delimiter as a comma does not come up and thus all the columns are concatenated with commas. Is there a way to get Excel to recognize the comma delimiter?

like image 253
user1661276 Avatar asked Sep 10 '12 21:09

user1661276


People also ask

How do I open a CSV file in Excel on a Mac?

Open a blank worksheet in Excel for Mac. From the main menu select: Data>Get External Data>Import Text File... From the Text Import Wizard (Step 1 of 3) select to open the file as Delimited and click Next. On (Step 2 of 3) set the Delimiters as: Semicolon and Comma with Text qualifier: as “ and click Next.

Is CSV compatible with Mac?

The strength of CSV files is that it is accessible everywhere, no matter the platform you're on – Windows, Mac, or Linux. Any spreadsheet application can access the contents of CSV files without any hiccups since the data is stored in plain text.


2 Answers

The trick is that you have to create a new workbook and then import the CSV file (i.e., via File / Import). In the CSV import dialog you can select things like the delimiter, encoding, etc.; whereas, you don't have the option of setting the delimiter character, etc. if you just open the existing CSV file directly.

This is also discussed here: https://apple.stackexchange.com/questions/23220/how-to-open-csv-file-with-microsoft-excel

like image 197
Sam Brannen Avatar answered Oct 04 '22 14:10

Sam Brannen


One way is to insert sep=yourdelimiter in the begining of the file.

If you generate the csv in PHP: fwrite($fileHandle, 'sep=yourdelimiter' . "\r\n");

Otherwise you can open your csv with a text editor and add sep=yourdelimiter to the begining of the file.

like image 45
user3202819 Avatar answered Oct 04 '22 13:10

user3202819