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

Read in specific line numbers from a text file (very large 1.5GB) using PowerShell

$
0
0

Hi all,

I have a large file (a text file) which is over 1.5GB in size. 

I need to read in specific line numbers from the file, I have a list of exact line numbers I wish to read.

If I use "get-content" to read in all the contents, PowerShell consumes 1.3GB in memory then crashes out.  I don't have enough memory to cope with using get-content to read in all the contents.

Is there any way of doing the following:

       $entry = get %linenumber% from %filename%

Any help is greatly appreciated!

Kathy


Kathleen Hayhurst Senior IT Support Analyst


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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