(Get-Content B:\EE\EE29174457\in.txt).replace('|', ',') | Set-Content B:\EE\EE29174457\out.txt
I would let Powershell do the conversation:
$inFile = 'input.txt'
$outFile = 'Output.csv'
Import-Csv -Path $inFile -Delimiter '|' | Export-Csv -Path $outFile -Delimiter ';' -NoType
My example does not work for one-liner TXT.
You need header either in the TXT or in the script.
$inFile = 'input.txt'
$outFile = 'Output.csv'
$headers = "One", "Two", "Three", "Four"
Import-Csv -Path $inFile -Delimiter '|' -Header $headers | Export-Csv -Path $outFile -Delimiter ';' -NoType
In the existing file, are there any double quotes, or commas?
»bp