Below is my script to replace comma's in an existing CSV file. The delimiter used is | The script works perfectly fine but takes a long time to replace. Do we have a faster approach to replace all instances of comma's with nothing.
$inform = Get-Content C:\product.csv
$inform | % {
$info = $_.ToString().Replace(",","")
$info | Out-file C:\product_comma_replaced.csv -Append
}
Input CSV:
1|Test,ABC|Test,LMN
Output CSV:
1|TestABC|TestLMN