July 1st, 2014

PowerTip: Use Custom Delimiter with CSV File

Doctor Scripto
Scripter

Summary: Use a custom delimiter with Windows PowerShell when reading a CSV file.

Hey, Scripting Guy! Question Can I use a delimiter other than the comma ( , ) when reading from a CSV file?

Hey, Scripting Guy! Answer Import-CSV has a parameter dedicated for this purpose called -Delimiter:

Get-Help Import-Csv -ShowWindow

Image of Help file

You can easily use this during the import:

Image of command output

Image of command output

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.