How to Change the Delimiters Used by Excel for CSVs

Transcription

Okay, so I have a CSV right here, also known as a comma-separated value file. And let’s say I wanted to change the delimiter in this file from commas to semi-colons. Now there’s not many rows in this particular file, so I could almost manually do it, but what if you want to do it quicker than that? Well I could do a find replace, so for example I did CTRL+F in this case in Notepad++, and then went to replace, I’m going search for comma, and I’m going to put semi-colon to replace it, but the problem with that, if I replace them all, you’ll notice that the names had commas in them, Kiley, Terra, and now that’s gone! It’s just a semi-colon, so I can’t do that, in this case. So I’m going to undo it, and then I’m going to save again.

Okay, so how do we get this file to have semi-colons instead of commas? Let’s say you have a lot of rows and you really don’t want to do it manually, here’s how you can do it. It’s a bit deep in Windows though. I’m going to open up the CSV in Excel, so we have it here, ready to go, alright. And then the next thing we’re going to do is we’re going to go to the Start button, we’re going to search for “region”, where it says “region settings”, I’m going to left-click that, it’s going to pop up. In this section, I’m going to scroll all the way to the bottom, click “additional date, time, & regional settings”. When the next window comes up, it’s going to be in the “clock and region” section, and I’m going to go to where it says “Region” and I’m going to click “Change date, time, and number formats” – okay, now when I’m there, what I’m going to do now is go to the bottom and click “additional settings.” See what I mean by deep in Windows?

Alright so right here you can see that there are a number of fields but the one we care about is the list separator field, it’s set to a comma. Change that to a semi-colon, or whatever you feel like changing it to, press Apply, okay, apply, okay, let’s just clean up by closing all these windows, okay. Excel is still open, we’re going to go to File, Save As, browse, and then here I’m gonna name it simply “Example2”, save, okay. I’m going to minimize this file – in Notepad++ I’m going to bring Example2 here, and what do we see? The semi-colons are there. Great! So it actually did what we wanted.

Now here’s the thing, after getting the outcome that you want, I recommend that you change the setting immediately back to what it was, otherwise every CSV moving forward would be treated as if it was supposed to have a semi-colon in between, which is not what the filename was meant to be [laughs], comma separated values, not semi-colon separated values. So I’m going to go back to the start menu, I’m going to search for regional settings, I’m going to go to the bottom of that, additional date time and regional settings, change date time and number formats, additional settings, and the list separator goes back to a comma. We press apply, we click okay, apply, okay, close our windows, and that’s it!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.