PowerTip: Use Custom Delimiter with CSV File

PowerTip: Use Custom Delimiter with CSV File

  • Comments 1
  • Likes

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

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment

  • Users who work with multiple languages and/or have configured different region/language should consider using the following to determine the system delimiter:

    $host.CurrentCulture.TextInfo.ListSeparator


    Thanks / rgds,


    http://www.leedesmond.com/