How to Change Default CSV Separator using Windows Culture Settings
Consider a situation where you get a CSV file from your client to import into your application. But the problem is your application supports pipe separated files only. Here one thing to note is that a CSV file is not always necessary to have a comma as a separator. It can also contain a pipe or some other character. The question is how can you change your default separator from comma to pipe character.
Let's jump to see how we can change these windows settings. Now I am in the control panel of my system which is Windows 10. In the control panel, first of all, you need to click on the region icon which will open one window, and then click on the additional settings button which opens a new pop up. Here, you can see the list separator.
Over here what you need to do is instead of comma I am changing it to a pipe character and then click on Apply and OK button. Once again click on the Apply and OK button.
Now let me show you a CSV file in the text editor which we will receive from the client to input in the application. Here you can see that this file is delimited by comma. Each column and the respective fields are delimited by a comma.
Open this file in Microsoft Excel. Once again save as the file and see what happened. In the Excel sheet click on the file menu and click on the save as option. Select the folder and give the other name which is like ImportPatient_123.csv and then click on the save button and close the file.
Here is our new file. Since I have changed my comma into pipe from the region culture setting, so what I expected to find now is to have a pipe as a delimiter. Let's check this file in the text editor. Open the file in the business studio and instead of comma now we have a pipe as a separator in the CSV file.
Even if you open this file in Excel then it looks the same as before. This is how you can change the default separator from the windows setting.
Other useful articles:
- CSV and Where It Is Used
- Essential Secrets of CSV
- Writing CSV - Secrets of CSV
- A Real-World Example of CSV Usage with PDF.co Cloud API
- Change Default CSV Separator Using Windows Culture Settings
- Escape Characters - Secrets of CSV
- Real-World Example of CSV Usage with Document Parser Template Editor
- Where Large CSV Files are Available and Where They Are Used