I have a csv file in path and i need to fetch the file and do Find & Replace $(dollar) value to ,(comma) using PowerShell script. please help me on the script .
CSV file
id|name|place
1|adam$|USA
2|john|USA
3|Jack$|England
Expected output : Need to do Find & Replace $(dollar) value to ,(comma) under name column
id|name|place
1|adam,|USA
2|john|USA
3|Jack,|England
Command Used
Import-csv D:\CSV\Customer.csv
ForEach-Object { $_.name -replace '$',',' }
i didn't got any error nor the expected changes. i need to update the values in existing CSV file
Below Answer by Zett42 works but
(Import-Csv D:\CSV\Customer.csv -Delimiter '|') |
Select-Object 'id',
@{ n = 'name'; e = { $_.name.Replace('$', ',') } },
'place' |
Export-Csv D:\CSV\Customer.csv -Delimiter '|'
but the tricky part is we are replacing the ,(Comma) value and rewriting the CSV files again, so CSV file creation part considers the value after ,(comma) as new column and move the value to column B instead of Column A.
Before :
After :

