You must Sign In to post a response.
Category: Sharepoint
#767549
I have not tried but you can query on log file (txt file) to split them in small files, see below snippet and see how it works for you
Thanks
Koolprasd2003
Editor, DotNetSpider MVM
Microsoft MVP 2014 [ASP.NET/IIS]
$reader = new-object System.IO.StreamReader("C:\Exceptions.log")
$count = 1
$fileName = "{0}{1}.{2}" -f ($rootName, $count, $ext)
while(($line = $reader.ReadLine()) -ne $null)
{
Add-Content -path $fileName -value $line
if((Get-ChildItem -path $fileName).Length -ge $upperBound)
{
++$count
$fileName = "{0}{1}.{2}" -f ($rootName, $count, $ext)
}
}
$reader.Close()
Thanks
Koolprasd2003
Editor, DotNetSpider MVM
Microsoft MVP 2014 [ASP.NET/IIS]
#767572
Hi,
If you want to split up your large file into smaller pieces then refer below link this might be helpful to you, "gallery.technet.microsoft.com/scriptcenter/PowerShell-Split-large-log-6f2c4da0"
--------------------------------------------------------------------------------
Give respect to your work, Instead of trying to impress your boss.
N@veen
Blog : http://naveens-dotnet.blogspot.in/
If you want to split up your large file into smaller pieces then refer below link this might be helpful to you, "gallery.technet.microsoft.com/scriptcenter/PowerShell-Split-large-log-6f2c4da0"
--------------------------------------------------------------------------------
Give respect to your work, Instead of trying to impress your boss.
N@veen
Blog : http://naveens-dotnet.blogspot.in/
Return to Return to Discussion Forum