View Single Post
Old 06-14-2007   #1 (permalink)
Chris Harris


 
 

Searching large text files

I have very large text files (100MB-500MB+) that I need to process in order
to extract useful pieces of information. Unfortunately, I can't find an
efficient way of doing this with powershell as get-content tries to pull the
entire contents of the file into memory and doesn't seem to store it there
very efficiently.

While I have 2GB of memory on my machine, I keep getting
System.OutOfMemoryException errors from get-content. When I look at the
powershell.exe process in task manager I see it using over 1.5GB of memory.

Is there a more efficient way to do this with Powershell?

Thanks,
Chris
My System SpecsSystem Spec