4

I'm trying to read a 50GB text file with a streamreader. It doesn't even get to reading the file, because my program freezes on the second line(of code, not the file).

string filename = @"C:\wikipedia\dump.xml";
StreamReader wikipediaReader = new StreamReader(filename);
string line = "";
while((line = wikipediaReader.ReadLine()) != null)
{
    Console.WriteLine(line);
    Console.ReadKey();
}
user1599078
  • 167
  • 1
  • 3
  • 9

3 Answers3

2

It could be anti-virus software trying to scan the file.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
0

You can also try using MemoryMappedFile to read file

Araym
  • 19
  • 4
-1

we have to use splitter and set the start position and endposition while reading the file

i advice you to check This Link.

if you still have issue , please let me know i will help you with the working code

Community
  • 1
  • 1
Fanish
  • 27
  • 5