Answer the question
In order to leave comments, you need to log in
How to batch edit csv with Powershell?
Good afternoon! It is necessary in a large number of csv files to batch replace , with ; for the correct display of the report in excel - how to do it as simply and quickly as possible or what to build on in the script?
Answer the question
In order to leave comments, you need to log in
Get-ChildItem *.csv | ForEach-Object { (Get-Content -Path $_.FullName) -replace ',', ';' | Set-Content -Path $_.FullName }
as a result my working variant - replacement of symbols + renaming of the file
cd c:\ps
Get-ChildItem *.csv | ForEach-Object { (Get-Content -Path $_.FullName) -replace '","', '";"' | Set-Content -Path "c:\PS\10.09.2017\Spb\10.09.2017_$($_.Name)" }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question