Using string split with tab characters in PowerShell 1.0 Using string split with tab characters in PowerShell 1.0 powershell powershell

Using string split with tab characters in PowerShell 1.0


You're using the wrong escape character for the tab. Try this instead:

$f = Get-Content "Users.txt"foreach ($line in $f) {    $fields = $line.Split("`t")    $fields.Count | Out-Host}


(Get-Content -LiteralPath C:\temp\Users.txt) | ForEach-Object {$_.Split("`t")} | Set-Content -Path C:\temp\Results.txt