Re: [msh]get-content of large files.
- From: "Nigel Sharples [MSFT]" <nigels@xxxxxxxxxxxxx>
- Date: Fri, 3 Mar 2006 17:22:49 -0800
Try replacing your foreach line with this:
get-content $filename | foreach {$_}
--
Nigel Sharples [MSFT]
Monad Test
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dung K Hoang" <dunghoangkhac@xxxxxxxxxxx> wrote in message
news:%23S$pmTyPGHA.5044@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for your prompt answer!
My code is quite simple. The script looks like:
param ( $filename = (read-host "Filename pls"))
foreach ( $line in get-content $filename -readcount 1) # Try with
readcount
{
$line
}
Here is my environment:
Windows XP SP2 - Monad Beta 3.0 - Locale US
Windows server 2003 SP1 x64 - Monad Beta 3.1 - Locale US
My script is reading Exchange Messages tracking logs, IIS 6 log and ISA
server 2004 log files.. The average size is 40 MB
The log files are text files in ASCII format and use the W3C standard
format
/Dung
"Jeff Jones [MSFT]" <jeffjon@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:eooNR6xPGHA.4220@xxxxxxxxxxxxxxxxxxxxxxx
Try specifying the -ReadCount parameter with a value of -1.
MSH > get-content largefile.txt -readcount -1
--
Jeff Jones [MSFT]
Monad Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Dung K Hoang" <dunghoangkhac@xxxxxxxxxxx> wrote in message
news:uXqIqvwPGHA.764@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I notice that when you use the cmdlet get-content on large files, it
takes some times before seeing output on the console.
I also observe that during the excution of the command, the virtual
memoery used by the process msh.exe can augment up to 300% and this
virtual memory is not released afterwards.
My question is: Is it a normal behavior? Any suggestion to use a
different cmdlet?
Thanks
/Dung
.
- Follow-Ups:
- Re: [msh]get-content of large files.
- From: Dung K Hoang
- Re: [msh]get-content of large files.
- References:
- [msh]get-content of large files.
- From: Dung K Hoang
- Re: [msh]get-content of large files.
- From: Jeff Jones [MSFT]
- Re: [msh]get-content of large files.
- From: Dung K Hoang
- [msh]get-content of large files.
- Prev by Date: Re: question about Excel object... (how to save but overwrite)
- Next by Date: Re: Not enough storage while running vb script
- Previous by thread: Re: [msh]get-content of large files.
- Next by thread: Re: [msh]get-content of large files.
- Index(es):
Relevant Pages
|