- Import or export text (.txt or .csv) files
- Import a text file by opening it in Excel
- Import a text file by connecting to it (Power Query)
- Export data to a text file by saving it
- Import a text file by connecting to it
- Export data to a text file by saving it
- Need more help?
- CSV with comma or semicolon?
- 10 Answers 10
- How to change Excel CSV delimiter to comma or semicolon
- What delimiter Excel uses for CSV files
- Change separator when saving Excel file as CSV
- Change delimiter when importing CSV to Excel
- Indicate separator directly in CSV file
- Choose delimiter in Text Import Wizard
- Specify delimiter when creating a Power Query connection
- Change default CSV separator globally
- Changing List separator: background and consequences
- You may also be interested in
Import or export text (.txt or .csv) files
There are two ways to import data from a text file with Excel: you can open it in Excel, or you can import it as an external data range. To export data from Excel to a text file, use the Save As command and change the file type from the drop-down menu.
There are two commonly used text file formats:
Delimited text files (.txt), in which the TAB character (ASCII character code 009) typically separates each field of text.
Comma separated values text files (.csv), in which the comma character (,) typically separates each field of text.
You can change the separator character that is used in both delimited and .csv text files. This may be necessary to make sure that the import or export operation works the way that you want it to.
Note: You can import or export up to 1,048,576 rows and 16,384 columns.
Import a text file by opening it in Excel
You can open a text file that you created in another program as an Excel workbook by using the Open command. Opening a text file in Excel does not change the format of the file — you can see this in the Excel title bar, where the name of the file retains the text file name extension (for example, .txt or .csv).
Go to File > Open and browse to the location that contains the text file.
Select Text Files in the file type dropdown list in the Open dialog box.
Locate and double-click the text file that you want to open.
If the file is a text file (.txt), Excel starts the Import Text Wizard. When you are done with the steps, click Finish to complete the import operation. See Text Import Wizard for more information about delimiters and advanced options.
If the file is a .csv file, Excel automatically opens the text file and displays the data in a new workbook.
Note: When Excel opens a .csv file, it uses the current default data format settings to interpret how to import each column of data. If you want more flexibility in converting columns to different data formats, you can use the Import Text Wizard. For example, the format of a data column in the .csv file may be MDY, but Excel’s default data format is YMD, or you want to convert a column of numbers that contains leading zeros to text so you can preserve the leading zeros. To force Excel to run the Import Text Wizard, you can change the file name extension from .csv to .txt before you open it, or you can import a text file by connecting to it (for more information, see the following section).
Import a text file by connecting to it (Power Query)
You can import data from a text file into an existing worksheet.
On the Data tab, in the Get & Transform Data group, click From Text/CSV.
In the Import Data dialog box, locate and double-click the text file that you want to import, and click Import.
In the preview dialog box, you have several options:
Select Load if you want to load the data directly to a new worksheet.
Alternatively, select Load to if you want to load the data to a table, PivotTable/PivotChart, an existing/new Excel worksheet, or simply create a connection. You also have the choice of adding your data to the Data Model.
Select Transform Data if you want to load the data to Power Query, and edit it before bringing it to Excel.
If Excel doesn’t convert a particular column of data to the format that you want, then you can convert the data after you import it. For more information, see Convert numbers stored as text to numbers and Convert dates stored as text to dates.
Export data to a text file by saving it
You can convert an Excel worksheet to a text file by using the Save As command.
Go to File > Save As.
In the Save As dialog box, under Save as type box, choose the text file format for the worksheet; for example, click Text (Tab delimited) or CSV (Comma delimited).
Note: The different formats support different feature sets. For more information about the feature sets that are supported by the different text file formats, see File formats that are supported in Excel.
Browse to the location where you want to save the new text file, and then click Save.
A dialog box appears, reminding you that only the current worksheet will be saved to the new file. If you are certain that the current worksheet is the one that you want to save as a text file, click OK. You can save other worksheets as separate text files by repeating this procedure for each worksheet.
You may also see an alert below the ribbon that some features might be lost if you save the workbook in a CSV format.
For more information about saving files in other formats, see Save a workbook in another file format.
Import a text file by connecting to it
You can import data from a text file into an existing worksheet.
Click the cell where you want to put the data from the text file.
On the Data tab, in the Get External Data group, click From Text.
In the Import Data dialog box, locate and double-click the text file that you want to import, and click Import.
Follow the instructions in the Text Import Wizard. Click Help on any page of the Text Import Wizard for more information about using the wizard. When you are done with the steps in the wizard, click Finish to complete the import operation.
In the Import Data dialog box, do the following:
Under Where do you want to put the data?, do one of the following:
To return the data to the location that you selected, click Existing worksheet.
To return the data to the upper-left corner of a new worksheet, click New worksheet.
Optionally, click Properties to set refresh, formatting, and layout options for the imported data.
Excel puts the external data range in the location that you specify.
If Excel does not convert a column of data to the format that you want, you can convert the data after you import it. For more information, see Convert numbers stored as text to numbers and Convert dates stored as text to dates.
Export data to a text file by saving it
You can convert an Excel worksheet to a text file by using the Save As command.
Go to File > Save As.
The Save As dialog box appears.
In the Save as type box, choose the text file format for the worksheet.
For example, click Text (Tab delimited) or CSV (Comma delimited).
Note: The different formats support different feature sets. For more information about the feature sets that are supported by the different text file formats, see File formats that are supported in Excel.
Browse to the location where you want to save the new text file, and then click Save.
A dialog box appears, reminding you that only the current worksheet will be saved to the new file. If you are certain that the current worksheet is the one that you want to save as a text file, click OK. You can save other worksheets as separate text files by repeating this procedure for each worksheet.
A second dialog box appears, reminding you that your worksheet may contain features that are not supported by text file formats. If you are interested only in saving the worksheet data into the new text file, click Yes. If you are unsure and would like to know more about which Excel features are not supported by text file formats, click Help for more information.
For more information about saving files in other formats, see Save a workbook in another file format.
The way you change the delimiter when importing is different depending on how you import the text.
If you use Get & Transform Data > From Text/CSV, after you choose the text file and click Import, choose a character to use from the list under Delimiter. You can see the effect of your new choice immediately in the data preview, so you can be sure you make the choice you want before you proceed.
If you use the Text Import Wizard to import a text file, you can change the delimiter that is used for the import operation in Step 2 of the Text Import Wizard. In this step, you can also change the way that consecutive delimiters, such as consecutive quotation marks, are handled.
See Text Import Wizard for more information about delimiters and advanced options.
If you want to use a semi-colon as the default list separator when you Save As .csv, but need to limit the change to Excel, consider changing the default decimal separator to a comma — this forces Excel to use a semi-colon for the list separator. Obviously, this will also change the way decimal numbers are displayed, so also consider changing the Thousands separator to limit any confusion.
Clear Excel Options > Advanced > Editing options > Use system separators.
Set Decimal separator to , (a comma).
Set Thousands separator to . (a period).
When you save a workbook as a .csv file, the default list separator (delimiter) is a comma. You can change this to another separator character using Windows Region settings.
Caution: Changing the Windows setting will cause a global change on your computer, affecting all applications. To only change the delimiter for Excel, see Change the default list separator for saving files as text (.csv) in Excel.
In Microsoft Windows 10, right-click the Start button, and then click Settings.
Click Time & Language, and then click Region in the left panel.
In the main panel, under Regional settings, click Additional date, time, and regional settings.
Under Region, click Change date, time, or number formats.
In the Region dialog, on the Format tab, click Additional settings.
In the Customize Format dialog, on the Numbers tab, type a character to use as the new separator in the List separator box.
In Microsoft Windows, click the Start button, and then click Control Panel.
Under Clock, Language, and Region, click Change date, time, or number formats.
In the Region dialog, on the Format tab, click Additional settings.
In the Customize Format dialog, on the Numbers tab, type a character to use as the new separator in the List separator box.
Note: After you change the list separator character for your computer, all programs use the new character as a list separator. You can change the character back to the default character by following the same procedure.
Need more help?
You can always ask an expert in the Excel Tech Community or get support in the Answers community.
CSV with comma or semicolon?
How is a CSV file built in general? With commas or semicolons? Any advice on which one to use?
10 Answers 10
In Windows it is dependent on the «Regional and Language Options» customize screen where you find a List separator. This is the char Windows applications expect to be the CSV separator.
Of course this only has effect in Windows applications, for example Excel will not automatically split data into columns if the file is not using the above mentioned separator. All applications that use Windows regional settings will have this behavior.
If you are writing a program for Windows that will require importing the CSV in other applications and you know that the list separator set for your target machines is , , then go for it, otherwise I prefer ; since it causes less problems with decimal points, digit grouping and does not appear in much text.
CSV is a standard format, outlined in RFC 4180 (in 2005), so there IS no lack of a standard. https://www.ietf.org/rfc/rfc4180.txt
And even before that, the C in CSV has always stood for Comma, not for semiColon 🙁
It’s a pity Microsoft keeps ignoring that and is still sticking to the monstrosity they turned it into decades ago (yes, I admit, that was before the RFC was created).
- One record per line, unless a newline occurs within quoted text (see below).
- COMMA as column separator. Never a semicolon.
- PERIOD as decimal point in numbers. Never a comma.
- Text containing commas, periods and/or newlines enclosed in «double quotation marks».
Only if text is enclosed in double quotation marks, such quotations marks in the text escaped by doubling. These examples represent the same three fields:
1,»this text contains «»quotation marks»»»,3
1,this text contains «quotation marks»,3
The standard does not cover date and time values, personally I try to stick to ISO 8601 format to avoid day/month/year — month/day/year confusion.
How to change Excel CSV delimiter to comma or semicolon
by Svetlana Cheusheva, updated on March 9, 2023
The tutorial shows how to change CSV separator when importing or exporting data to/from Excel, so you can save your file in the comma-separated values or semicolon-separated values format.
Excel is diligent. Excel is smart. It thoroughly examines the system settings of the machine it’s running on and does its best to anticipate the user’s needs … quite often to disappointing results.
Imagine this: you want to export your Excel data to another application, so you go save it in the CSV format supported by many programs. Whatever CSV option you use, the result is a semicolon-delimited file instead of comma-separated you really wanted. The setting is default, and you have no idea how to change it. Don’t give up! No matter how deep the setting is hidden, we’ll show you a way to locate it and tweak for your needs.
What delimiter Excel uses for CSV files
To handle .csv files, Microsoft Excel uses the List separator defined in Windows Regional settings.
In North America and some other countries, the default list separator is a comma, so you get CSV comma delimited.
In European countries, a comma is reserved for the decimal symbol, and the list separator is generally set to semicolon. That is why the result is CSV semicolon delimited.
To get a CSV file with another field delimiter, apply one of the approaches described below.
Change separator when saving Excel file as CSV
When your save a workbook as a .csv file, Excel separates values with your default List separator. To force it to use a different delimiter, proceed with the following steps:
- Click File >Options >Advanced.
- Under Editing options, clear the Use system separators check box.
- Change the default Decimal separator. As this will change the way decimal numbers are displayed in your worksheets, choose a different Thousands separator to avoid confusion.
Depending on which separator you wish to use, configure the settings in one of the following ways.
To convert Excel file to CSV semicolon delimited, set the default decimal separator to a comma. This will get Excel to use a semicolon for the List separator (CSV delimiter):
- Set Decimal separator to comma (,)
- Set Thousands separator to period (.)
To save Excel file as CSV comma delimited, set the decimal separator to a period (dot). This will make Excel use a comma for the List separator (CSV delimiter):
- Set Decimal separator to period (.)
- Set Thousands separator to comma (,)
If you want to change a CSV separator only for a specific file, then tick the Use system settings check box again after exporting your Excel workbook to CSV.
Note. Obviously, the changes you’ve made in Excel Options are limited to Excel. Other applications will keep using the default List separator defined in your Windows Regional settings.
Change delimiter when importing CSV to Excel
There are a few different ways to import CSV file into Excel. The way of changing the delimiter depends on the importing method you opted for.
Indicate separator directly in CSV file
For Excel to be able to read a CSV file with a field separator used in a given CSV file, you can specify the separator directly in that file. For this, open your file in any text editor, say Notepad, and type the below string before any other data:
- To separate values with comma: sep=,
- To separate values with semicolon: sep=;
- To separate values with a pipe: sep=|
In a similar fashion, you can use any other character for the delimiter — just type the character after the equality sign.
Once the delimiter is defined, you can open your text file in Excel like you normally would, from Excel itself or from Windows Explorer.
For example, to correctly open a semicolon delimited CSV in Excel, we explicitly indicate that the field separator is a semicolon:
Choose delimiter in Text Import Wizard
Another way to handle a csv file with a delimiter different from the default one is to import the file rather than open. In Excel 2013 an earlier, that was quite easy to do with the Text Import Wizard residing on the Data tab, in the Get External Data group. Beginning with Excel 2016, the wizard is removed from the ribbon as a legacy feature. However, you can still make use of it:
- Enable From Text (Legacy) feature.
- Change the file extension from .csv to .txt, and then open the txt file from Excel. This will launch the Import Text Wizard automatically.
In step 2 of the wizard, you are suggested to choose from the predefined delimiters (tab, comma, semicolon, or space) or specify your custom one:
Specify delimiter when creating a Power Query connection
Microsoft Excel 2016 and higher provides one more easy way to import a csv file — by connecting to it with the help of Power Query. When creating a Power Query connection, you can choose the delimiter in the Preview dialog window:
Change default CSV separator globally
To change the default List separator not only for Excel but for all programs installed on your computer, here’s what you need to do:
- On Windows, go to Control Panel >Region settings. For this, just type Region in the Windows search box, and then click Region settings.
In the Region panel, under Related settings, click Additional date, time, and regional settings.
Under Region, click Change date, time, or number formats.
In the Region dialog box, on the Formats tab, click Additional settings…
In the Customize Format dialog box, on the Numbers tab, type the character you want to use as the default CSV delimiter in the List separator box.
For this change to work, the List separatorshould not be the same as Decimal symbol.
When done, restart Excel, so it can pick up your changes.
- Modifying the system settings will cause a global change on your computer that will affect all applications and all output of the system. Do not do this unless you are 100% confident in the results.
- If changing the separator has adversely affected the behavior of some application or caused other troubles on your machine, undo the changes. For this, click the Reset button in the Customize Format dialog box (step 5 above). This will remove all the customizations you’ve made and restore the system default settings.
Changing List separator: background and consequences
Before changing the List separator on your machine, I encourage you to carefully read this section, so you fully understand possible outcomes.
First off, it should be noted that depending on the country Windows uses different default separators. It’s because large numbers and decimals are written in different ways across the globe.
In the USA, UK and some other English-speaking countries including Australia and New Zealand, the following separators are used:
Decimal symbol: dot (.)
Digit grouping symbol: comma (,)
List separator: comma (,)
In most European countries, the default list separator is a semicolon (;) because a comma is utilized as the decimal point:
Decimal symbol: comma (,)
Digit grouping symbol: dot (.)
List separator: semicolon (;)
For example, here’s how two thousand dollars and fifty cents is written in different countries:
US and UK: $2,000.50
How does all this relate to the CSV delimiter? The point is that the List separator (CSV delimiter) and Decimal symbol should be two different characters. That means setting the List separator to comma will require changing the default Decimal symbol (if it’s set to comma). As the result, numbers will be displayed in a different way in all your applications.
Moreover, List separator is used for separating arguments in Excel formulas. Once you change it, say from comma to semicolon, the separators in all your formulas will also change to semicolons.
If you are not ready for such large-scale modifications, then change a separator only for a specific CSV file as described in the first part of this tutorial.
That’s how you can open or save CSV files with different delimiters in Excel. Thank you for reading and see you next week!
You may also be interested in
Table of contents
This is the most recent post on that topic I could find, which tells me, that this problem has still not been SUSTAINABLY resolved by the «software giant» (as one said here) Microsoft .
The only sustainable way to resolve it — and not the whole world is the United States of America, so we DO NEED such a resolution — would be a seamlessly added EXPORT filter, allowing to replace the the decimal and field separators of the csv saved by Excel .
Actually this could also be achieved — as a workaround — by a well-crafted VBA macro.
But we DO NEED this as a built-in function of Excel and this can only be done by Microsoft as the manufacturer of their (international . ) Office suite, right ?
Remark:
When writing such a macro (as a workaround), you would not only have to replace , and ;
Be aware that the csv specification also allows the use of of the separator WITHIN a field, when using special delimiters, like that:
. , «This is a text, aint it», 64.7, .
So you would have to take care of such «exceptions», otherwise you’d spoil the whole csv.
Anyway thanks to all, contributing ideas to this thread, including Svetlana for describing all EXISTING workarounds (which are only a crutch in my opinion; sorry Svetlana, that’s not your fault of course !)
FINALLY.
Would anyone of you know where to request such a «feature» at Microsoft directly ?
Any developers forum we could jointly add such a request and could gather others, who hopefully agree with us and demand such a priority change with their next release ?
This is rediculous. How can a BIG software giant as Microsoft think in this way!?
Let us set the separator manually.
If you look at some other software that import/export CSV they use comma as separator and put all the information within quotes. If there is a quote in the information it is escaped.
I guess there’s some old standard from 1965 stating how a CSV should be. 🙁
Hi all, Svetlana is not true at all, but only partially. I will explain.
If you use English locale and you in Excel change decimal separator from system to comma, Excel understand that he cannot use comma as a field delimiter and will use semicolon instead of it and will save csv file in non-english format, it is for example: 1,5;23,45.
But, in the case you are working with for example Czech locale (or probably with French locale) and you in Excel change a decimal separator to dot as correct for English csv and save this file. The format of file is for example: 1.5;23;45 and not expected 1.5,23.45. The reason is, I guess, that Excel has no any reason to change a field separator from semicolon to comma, because semicolon is a correct field separator for csv file and and does not contradict with the dot or comma decimal delimiter at all.
So with English locale you can save an usual non-english csv with comma decimal delimiter and semicolon field separator, but with non-english locale (Czech or French) you cannot save usual English csv, with dot decimal delimiter and comma field separator, but you can save alternative English csv, with dot decimal delimiter and semicolon field separator.
Of course another possibility is to switch locale with other possible problems, for example with other application.
Best regards,
Martin Molhanec
All works as intended. Microsoft 365 Apps for Enterprise.
Decimal and Thousands separators can be changed in my case — just mind the emtpy space character that you HAVE to delete!
[ 0. 0. 0. 1. 7. 6. 0. 0. 0. 0. 0. 2. 4. 1.
0. 0. 2. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 34. 128. 106. 6. 0. 23. 4.
1. 95. 128. 42. 18. 7. 128. 15. 2. 18. 16. 4. 10. 23.
46. 6. 10. 73. 79. 1. 0. 1. 19. 12. 29. 128. 83. 27.
10. 5. 29. 7. 3. 23. 82. 128. 128. 25. 128. 71. 13. 15.
25. 40. 66. 51. 37. 43. 25. 81. 128. 19. 5. 12. 47. 43.
20. 73. 13. 19. 14. 8. 40. 77. 52. 23. 48. 22. 14. 6.
5. 38. 31. 37. 78. 29. 4. 1. 37. 36. 56. 81. 20. 9.
3. 6.];[ 0. 0. 0. 1. 7. 6. 0. 0. 0. 0. 0. 2. 4. 1.
0. 0. 2. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 34. 128. 106. 6. 0. 23. 4.
1. 95. 128. 42. 18. 7. 128. 15. 2. 18. 16. 4. 10. 23.
46. 6. 10. 73. 79. 1. 0. 1. 19. 12. 29. 128. 83. 27.
10. 5. 29. 7. 3. 23. 82. 128. 128. 25. 128. 71. 13. 15.
25. 40. 66. 51. 37. 43. 25. 81. 128. 19. 5. 12. 47. 43.
20. 73. 13. 19. 14. 8. 40. 77. 52. 23. 48. 22. 14. 6.
5. 38. 31. 37. 78. 29. 4. 1. 37. 36. 56. 81. 20. 9.
3. 6.];True
Please need to make a code or tools to be three above details as a column, its mean [ ] [ ] True as a three columns
This instruction doesn’t work:
«To save Excel file as CSV comma delimited, set the decimal separator to a period (dot). This will make Excel use a comma for the List separator (CSV delimiter):»
I’ve just retested it in my Excel 365 — it does work as described. What Excel version do you use?
I had the same problem, could not change the list separator modifying it in Excel 2016 Professional. The file I was trying to convert, had to be used in another program that uses the comma as list separator (forScore).
I confirm the second option, the global change of the list separator. This has the draw-back that it interferes with other simulating programs. So, after converting the file, I had to restore the configuration for my other simulators to work properly again.
How did you test the first approach?
Here’s what I did:
— Performed the steps described in «Change separator when saving Excel file as CSV». In particular, set Decimal separator to period (.) and Thousands separator to comma (,).
— Saved the workbook as CSV file.
— Opened the CSV file in Notepad to check which separator is actually used. In my case, the result is always comma-separated values.
Same story for me.
And i am not allowed to change global setting by company policy, so no alternative there.
Hi Svetlana,
for me with Excel 365 it is not working.
Allthough doing all steps and chekcing it twice, result is still semicolon separataed.
The semicolon is still there since perhaps you have missed this part «For this change to work, the List separator should not be the same as Decimal symbol.» on the article.
If all above do not work and you want to properly read/modify csv which source file has comma as separator and dot as delimiter just open it in an editor, I used vsc for example. Mark all commas in the file, change them to semicolons after that mark all dots if you have numbers and change them to commas.
Office 365, version 2108. comma delimited doesn’t work for me as well. All done with the description from this article.
Microsoft it’s shame we cannot do it Excel :/
Copyright © 2003 – 2023 Office Data Apps sp. z o.o. All rights reserved.
Microsoft and the Office logos are trademarks or registered trademarks of Microsoft Corporation. Google Chrome is a trademark of Google LLC.