190

CSV files are automatically associated with Excel but when I open them, all the rows are basically in the first column, like this:

enter image description here

It's probably because when Excel thinks "comma-separated values", it actually searches for some other delimiter (I think it's semicolon but it's not important).

Now when I have already opened this file in Excel, is there a button or something to tell it "reopen this file and use comma as a delimiter"?

I know I can import the data into a new worksheet etc. but I'm asking specifically for a help with situation where I already have a CSV file with commas in it and I want to open it in Excel without creating new workbook or transforming the original file.

  • 2
    For a number of reasons, beyond just the delimiter, it is a very bad idea to let Excel open CSV (or any other plain text file) using the default settings. Depending on your source file, you -will- corrupt your data. I've written an in depth article on this over here: theonemanitdepartment.wordpress.com/2014/12/15/… – Wouter Dec 16 '14 at 14:00
  • 3
    It is so hard to understand what must be going on inside of Microsoft that Excel still cannot open CSV files just like that. It also breaks numbers etc. in astonishing ways. Even JavaScript does not implicitly convert that badly. – usr Jun 18 '17 at 9:55
  • Sorry to grave dig.. but there's a very good chance the fact your first line doesn't have any commas causes Excel to give up trying – patricktokeeffe Dec 22 '17 at 0:18
  • Just use ; as delimeter and opening file with double-click will separte it in columns in MS Excel. – Hrvoje T Jan 17 at 19:31

13 Answers 13

176

Go to the Data tab and select text to columns under data tools then select delimited and hit next. Then select comma as the delimiter and hit finish

enter image description here

  • 51
    And you have to do that every time after double-clicking *.csv in Windows Explorer? I somehow can't believe there is no simpler way, especially if Excel associates itself with the *.csv file extension. – Borek Bernard Mar 31 '12 at 20:50
  • 3
    Usually a wizard should pop up making you do this process when you open the file, but if it's not, you can do it this way. You can also go to data - get external data - from text and run the import wizard from there. – Raystafarian Mar 31 '12 at 20:52
  • 11
    That's the problem, I don't want to import any data, I am opening a perfectly valid CSV file that Excel even associated itself with. But OK, if that's how it is I'll probably need to find something else to edit CSV files. – Borek Bernard Mar 31 '12 at 21:20
  • 2
    Yes its a PITA, same here with Excel 2003. I also have to use Data\Import. Not really a problem in itself, but I do these imports only twice a year so I regularly forget and try File/Open first ;-( – Jan Doggen Jan 31 '14 at 18:10
  • 1
    @gstackoverflow you can, just select the A column and then do this. – Tom Feb 6 '16 at 12:24
158

Placing:

sep=<delimeter>

as the first line of your csv file will automatically tell Excel to use that character as the separator instead of the default comma.

E.g:

sep=|
COLUMN1|COLUMN2
data,1|data2
...

will result in pipe (|) being used as the delimeter instead the comma, without the user having to run in through the import wizard first.

  • 7
    For this to work in Excel 2013, you must uncheck Use system separators in Options>Advanced – Michael Field Mar 26 '15 at 7:06
  • 1
    Can you define the decimal separator in a similar way? I want it to be ., e.g., for 1.5 but in my system . is the separator for thousands. – CGFoX Jan 26 '17 at 8:46
  • 2
    This worked for me, even if I have "Use system separators" checked. No other solution worked for me. – awe Feb 15 '17 at 13:54
  • Confirming that this works in Excel 2016 with "Use system separators" checked. This is great. – Bas May 15 '17 at 13:57
  • Perfect solution to a stupid problem! (Excel should be able to recognize separator used, or at least asked me, and let me decide!) Next up: is it possible to force Excel to use another charset as well? All my CSV are in UTF-8, but Excel tries to open them as 'Macintosh', which is creating a lot of problems for me!! – qualbeen Oct 25 '17 at 11:53
49

I don't know if you managed to resolve this issue, but I also had the same problem and sorted it out after some investigations.

Turns out it was a regional setting issue;

Go into your control panel --> Regional Settings --> Advanced Settings and change your list separator to a comma.

Mine was set to semi-colon for South Africa after I changed to Windows 8. After I changed it to a comma, all my CSV's open correctly with Excel 2013.

Hope this helps.

Additional comment:
I used the same steps as Lèse majesté, but I also changed the Decimal symbol from a comma (,) to a fullstop (.) and it fixed my problem.

This is because, by Default, Windows 8 uses a comma as a Decimal symbol and Excel gets confused when it has to use both the characters as separator and Decimal symbol.

  • Already set like this, and ignored by excel. Still doesn't separate on commas. – Elliot Sep 23 '14 at 20:45
  • Ir probably requires at least a logoff, logon to take effect. – Gert van den Berg Jan 11 '16 at 10:49
  • Worked for me after changing the decimal symbol, thanks! – James Cameron Oct 14 '16 at 9:20
  • Well, I still think it is outrageus that Excel use regional settings for how to read a file format! – awe Feb 15 '17 at 13:44
  • Thanks. This setting solved a huge issue for me at work. Excel is so stupid! – Moha Aug 30 '18 at 12:37
19

This is what worked for me - it is a combination of some of the answers here.

(Note: My PC is using a Czech format settings that format numbers like this: 1 000,00, i.e., comma is used as a decimal separator and space as a thousands separator. The default list separator in system settings is ;.)

  1. I changed the system List separator to a comma in Region -> Additional settings
  2. In Excel 2013, I went to Options -> Advanced and unchecked Use system separators (under "Editing Options", which is the first section)
  3. I set decimal separator in Excel to . and the thousands separator to , (the thousands separator probably doesn't matter but I wanted to make it consistent with the US formatting)

An alternative to steps 2+3 would be to change these settings in the system settings (step 1) but I generally want to have numbers formatted according to a Czech locale.

Downsides: in Excel, I now need to enter decimal numbers using the US locale, i.e. using the dot instead of a comma. That feels a bit unnatural but is an acceptable trade-off for me. Fortunately, the comma key on my num-pad turned to the dot key automatically (and only in Excel - other apps still output a comma).

  • It does not work with Excel 2010 / cz :-( – Leos Literak Nov 27 '14 at 8:00
  • @LeosLiterak: I just tried it in Excel 2013 though, and it worked. – Sk8erPeter Jan 24 '17 at 15:06
10

Apparently Excel uses a Windows 7 regional setting for the default delimiter for CSVs (which is apparently a tab by default). You can change that setting like so.

However, I don't know what other repercussions this will have. I suppose if all the CSV files on your computer are comma separated, then there shouldn't be any problems. But if you have another (likely Microsoft) program that also uses CSV files, and it normally uses CSVs formatted with a different delimiter, then this could be problematic.

E.g. if, say, Outlook uses tab-separated CSVs for importing/exporting contacts, and you receive such CSVs from an outside source (Gmail, another computer, whatever...), then changing this system-wide setting could prevent Outlook from opening these tab-separated CSVs.

  • 3
    I've tried changing my "regional and language settings" > Formats > Additional settings > List separator, however, it had no effect on opening CVS files in Excel. So unfortunately, it's not a solution. – Borek Bernard Apr 1 '12 at 16:47
  • 2
    Same here with Excel 2010 and Windows 7. It was already , in my settings, and Excel is still defaulting to tab. – rhsatrhs Nov 30 '12 at 22:01
  • Any idea if we can enter 2 different characters in this box in Control Panel? E.g. ;, to allow both characters as list seaparators? – Dzhuneyt Sep 1 '14 at 8:51
7

LibreOffice Calc has a very advanced csv filter that lets you choose separators, formats and encodings. I work extensively with data in various formats and very often need to send these data in Excel format to users. I use LibreOffice Calc to convert csv-files to the desired format, then save as xls.

This may not answer how to do it easily in Excel but it answers how to do it easily, especially as OP in the comments suggests using something other than excel would be an acceptable option.

4

Excel 2010 - In addition to validating your Regional Advanced Settings, be sure to check your Excel Advanced setting:

File -> Options -> Advanced

Make sure "Use system separators" is checked.

  • 2
    Or, of course, be sure it's not checked if you want to import something that is different from your regional settings. :-) But: it's good to know this setting exists; I never heard of it before. – Arjan Jan 31 '14 at 18:25
  • 1
    These settings only seem to influence the number separators, not the list separator. – Borek Bernard Jul 7 '14 at 10:16
3

A step-by-step guide for the perplexed:

  1. Press the Windows key
  2. Type "intl.cpl" and hit Enter.
  3. Click "Additional Settings".
  4. Go to the "Numbers" tab:
  5. Change the Decimal Symbol to a dot.
  6. Change the "Digit Grouping Symbol" to a space.
  7. Change the "List Separator" to a comma.
  8. Go to the "Currency" tab:
  9. Change the Decimal Symbol to a dot.
  10. Change the "Digit Grouping Symbol" to a space.
  • That's fine if you're always using your self-created .CSV files. But it doesn't work when you get a file from someone else who used a comma as separator. – stevenvh Jul 24 '17 at 9:10
0

Changing decimal separator to . (dot) and list separator to , (comma) helped to maintain CSV in normal view in Excel in Norwegian computers.

0

For my system, the settings were already set to what others here have suggested (Decimal symbol set to . (dot) and List Separator set to , (comma) BUT I was still having the display issues importing a CSV file exported from a different application.

After a little trial and error, I found a solution that opens every CSV file in the correct view.

Here is what worked for me in Excel 2013 with Windows 8:

Control Panel> Clock, Language, and Region> Region> Additional Settings> List separator set to , ; (comma AND semi colon) -> click "apply" and then see if that does the trick.

0

In Excel, DATA tab, in the Get External Data subsection, click "From Text" and import your CSV in the Wizard.

0

I know that an answer has already been accepted, but one item to check is the encoding of the CSV file. I have a Powershell script that generates CSV files. By default, it was encoding them as UCS-2 Little Endian (per Notepad++). It would open the file in a single column in Excel and I'd have to do the Text to Columns conversion to split the columns. Changing the script to encode the same output as "ASCII" (UTF-8 w/o BOM per Notepad++) allowed me to open the CSV directly with the columns split out. You can change the encoding of the CSV in Notepad++ too.

  • Menu Encoding > Convert to UTF-8 without BOM
  • Save the CSV file
  • Open in Excel, columns should be split
  • ASCII and UTF-8 w/o BOM are not the same thing. Actually, ASCII fits into UTF-8 w/o BOM seamlessly as UTF-8 has that covered in the standard. As soon as characters not covered in ASCII come around it could just output ANSI or UTF-8 instead... If you output never has anything out of ASCII then it's fine – sinni800 Oct 26 '15 at 13:30
0

With the newer Excel version 2010 you can open (menu: File, Open, or control-O) a .CSV file as a text file. Then, you directly get the wizard, just as easy as with LibreOffice Calc, where you can select the correct field delimiter.

enter image description here

This only works with files with the proper .CSV extension. My app was to produce CSV output with a .ACC extension, and trying to open that in excel with the method above, leads you to completely different excel corners :-(

protected by Community Oct 26 '15 at 14:12

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.