In Windows, how can I restore original characters to a csv file that have been replaced with hex ASCII?

StackOverflow https://stackoverflow.com/questions/23685174

문제

I have a csv file that contains names Like O'Brien that appear as O%27Brien or St. Something that appear as St%2ESomething. I don't have access to generate a new csv of this data, and I need the names in a correct format because I'm writing a PowerShell script to search for the names on another server.

I tried implementing something similar to the answer to this but I can't get it to work for the problem I'm experiencing.

It doesn't matter to me if the solution is in PowerShell as long as I can run it on Windows 7.

도움이 되었습니까?

해결책

Use the Uri.UnescapeDataString method which you can call from powershell like this:

# > [Uri]::UnescapeDataString("O%27Brien")
O'Brien
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top