Reading a big textFile

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

  • Author
    Posts
  • #6008

    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

    Thanks
    Kai

    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.

You must be logged in to reply to this topic.