Project 1999

Go Back   Project 1999 > Blue Community > Blue Server Chat

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 05-13-2013, 01:42 PM
August August is offline
Fire Giant


Join Date: Sep 2010
Posts: 703
Default

The problem with trying to load a file such as this is that most programs are going to load the entirety of the file into memory. How much memory do you have? IF its not significantly over 4GB, you're hosed.

You could also just stop trying to find the solution and create one yourself:

void ReadAndWrite()
{
System.IO.StreamReader InFile= new System.IO.StreamReader("c:\\myeqlog.txt");



for(int n=0; n<1000; n++)
{
System.IO.StreamWriter OutFile= new System.IO.StreamWriter(@"C:\MyEQLog"+n);
Count = 0;
while((line = file.ReadLine()) != null && Count <1000)
{
Outfile.WriteLine (line);
Count ++;
}
OutFile.Close();
}
InFile.Close();
}

This is purely from general memory. Basically, open a stream on the file. Read in 1000 lines, output a thousand lines, increment your logname - rinse and repeat. This will let you choose how large of file chunks you want ( by changing count). You probably also need to generate a new file name somewhat diffrerently - i'm not sure the way i did it would compile and I'm lazy.

-Tomtee
Last edited by August; 05-13-2013 at 02:06 PM..
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:52 PM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.