PowerTip: Use PowerShell to Read Tab Delimited File

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

Comments (4)

  1. Avinasha says:

    Hey, Scripting guys,
    I’m new to powershell, I cant use this "’t" as delimiter value. It says that Can’t convert to System.Char must be exactly one char long. Help me to use this back tick T!! Here is what I’m trying to do. Thanks

    Get-Process | ConvertTo-CSV -NoTypeInformation -Delimiter "’t"

  2. espen1 says:

    Hey Avinasha it´s ` not ´.

  3. Saily says:

    "t" or "not" does not work. I am getting same error message as Avinasha.

  4. adam says:

    It’s `t

    That’s backtick ( ` ), not apostrophe ( ‘ ). Usually the key to the left of the 1 on most keyboard layouts.