Replacing special characters in text file using PowerShell

6,324

Appleoddity's referenced article covers what I am looking for. Thanks! https://stackoverflow.com/questions/4126603/powershell-or-batch-find-and-replace-characters

Share:
6,324
Bjørn H. Sandvik
Author by

Bjørn H. Sandvik

Long-time do-it-all'er to all things computer-y.

Updated on September 18, 2022

Comments

  • Bjørn H. Sandvik
    Bjørn H. Sandvik over 1 year

    I would normally use Perl and regex for this, but to simplify portability between Windows computers, I am hoping to accomplish the following using PowerShell instead:

    A CSV file containing incorrectly encoded characters needs to be parsed and corrected. The natural language in question is Norwegian.

    Output from a third party system substitutes the characters æ ø å with ‘ › †

    As I am not comfortable with PowerShell at all at the present, I was hoping someone could mock up a small script which reads a source text file from disk and outputs it into another.

    Thank you