I am trying to use PowerShell to change the encoding of a .csv file. This is what I have tried but it's not working.
First Attempt: (this works outside Switch)
Get-ChildItem *.csv | % { (Get-Content $_) | Set-Content "$($_.basename).csv" -encoding ASCII }
Second Attempt:
(Get-Content -Encoding UCS-2 LE BOM $FILENAME ) | Out-File -Encoding ANSI $FILENAME
Third Attempt:
get-content $yourfile | out-file $yourfile -encoding utf8
What am I doing wrong here? Any help would be much appreciated.
Using PowerShell to change encoding of a .csv file.
Re: Using PowerShell to change encoding of a .csv file.
Most issues in command line get fixed when you not only calling the command but specifying the whole path to the binary itself.
If it works in shell, it should work in Switch. Otherwise it's all about settings and not the command itself.
If it works in shell, it should work in Switch. Otherwise it's all about settings and not the command itself.
Re: Using PowerShell to change encoding of a .csv file.
Switch can be a bit picky when it comes to Execute Command stuff, in some cases you have to run a shellscript (or BAT) file with your command in it to get it to work.
I have made an APP for this called "Execute Command Friend" and it let you construct Shellscripts or BAT files with Switch variables that you call from the Execute Command Configurator.
I have made an APP for this called "Execute Command Friend" and it let you construct Shellscripts or BAT files with Switch variables that you call from the Execute Command Configurator.