Senin, 14 Februari 2011

Powershell - Powertips: Reading Text Files as One Chunk

I get emails from powershell.com that are worth sharing (and remembering). These are not my scripts. Signup for daily PowerTips here: http://powershell.com/cs.

In a previous tip, you learned how to quickly read in text files. The result was a string array. If you want to read the text as one large string ultrafast, you can use this approach:

[System.IO.File]::ReadAllText(“c:\somefile.txt“)

0 komentar:

Posting Komentar

 
Powered by Blogger