Powershell Import-csv: how to change delimiter from comma to semicolon

Sounds simple, and indeed it is simple. But I spent too much time searching for the correct syntax… this is the reason for this short article.

You use the Import-CSV command to import comma separated data from a .csv file?

Unfortunately, some of the values are containing commas. When you are not able to change the values you have to change the delimiter. Eg. from comma to semicolon.

This is really simple, just add the parameter –Delimiter to the Import-CSV command:

Import-CSV C:\temp\test.csv –Delimiter “;”

Note: put the ; in quotes!

Do not forget to replace all separating commas in the .csv file. Of course, you have to replace them in headings, too (if present)

That’s it!

Leave a Comment

Your email address will not be published. Required fields are marked *