Re: [msh]get-content of large files.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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






.



Relevant Pages

  • Re: [msh]get-content of large files.
    ... As for the virtual memory issue, ... If I simply run the script, the process memory consumption does not grow. ... The log files are text files in ASCII format and use the W3C standard ... I also observe that during the excution of the command, ...
    (microsoft.public.windows.server.scripting)
  • Re: [msh]get-content of large files.
    ... As for the virtual memmory issue, in the time-expression, if I redirect the ... output of the script to $Null then everything is OK! ... As for the virtual memory issue, ... The log files are text files in ASCII format and use the W3C standard ...
    (microsoft.public.windows.server.scripting)
  • Re: Recording AD Logons to SQL Database
    ... and from what pc by running the code below in my login script. ... ' Specify SQL Server, Instance name, and database. ... on demand to combine them into a single csv file. ... intervention is required in order to keep the log files to a reasonable size ...
    (microsoft.public.windows.server.scripting)
  • Re: [Info-Ingres] Setting up Ingres Security Auditing for query_text
    ... of a shell script to archive the audit files, ... refusing to restart if there is a problem in the log files. ... Register into a normal database, ... Set the audit files to be small to test file "switching". ...
    (comp.databases.ingres)
  • Re: VBScript cant read NTBackup log files
    ... Even though the log files appear to be text files, my script returns the same three garbage characters from every NTBackup log file. ...
    (microsoft.public.windows.server.scripting)