Brains Coders

Brains Engineering Blog

C# Reading huge text file or CSV in the fastest way

Here is the code that have high performance on reading large text files:


using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (BufferedStream bs = new BufferedStream(fs))
using (StreamReader sr = new StreamReader(bs))
{
    string line;
    while ((line = sr.ReadLine()) != null)
    {

    }
}

Comments (1) -

  • zZqomnDweU2x

    7/27/2017 1:47:14 PM | Reply

    428514 707621hey very good internet site i will definaely come back and see once again. 679965

Loading