Reading a big textFile

Welcome Forums General PowerShell Q&A Reading a big textFile

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
  • #6008

    Points: 0
    Rank: Member

    by KaiY at 2013-01-29 05:34:00

    Hi guys,

    I have a quite big textfile which I want to read in:

    $Path = "C:\temp\MyBigFile.txt"

    $Lines = ${C:\temp\MyBigFile.txt} #this works fine
    $Lines = ${$Path} #that produces an error

    Can you help me how to use the variable $Path between {} ?

    I know "get-content", but the code above is much faster for big files


    by DonJ at 2013-01-29 14:07:30

    ${} syntax is for defining variables – for example, ${this is a valid variable name}. It's not actually reading your file into memory, it's doing that at the time you access $lines.

The topic ‘Reading a big textFile’ is closed to new replies.