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