August 25th, 2014

PowerTip: Use PowerShell to Read Tab Delimited File

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to read a Tab delimited file.

Hey, Scripting Guy! Question How can I use Windows PowerShell to read a Tab delimited file?

Hey, Scripting Guy! Answer Use the Import-CSV cmdlet and specify a delimiter of `t, for example:

$a = Import-Csv -Delimiter "`t" -Path c:\fso\mytabfile.tsv

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.

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • Russ Beinder

    It may have gotten mixed up in the rendering of this answer, but a grave (`) character must preceed the letter t; quotes are optional.
    $a = Import-Csv -Delimiter `t – Path c:\fso\mytabfile.tsv