Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Encoding with IO.File

$
0
0

I need to reada large file (1,5 Gb).

For performance issues, I'm trying to use the [IO.File] instead of the Get-Content, but am having trouble withaccents.

If I'm not mistaken,my fileis ANSI.

Follows the script.

    $r = [IO.File]::OpenText($Nome_Arquivo)
    while ($r.Peek() -ge 0) {
        $Linha = $r.ReadLine()
        $Linha
    }
    $r.Dispose()

Fábio de Paula Junior


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>