How to read massive amounts of text files performatically?

Vinicius

New member
Joined
Apr 28, 2020
Messages
1
Programming Experience
1-3
hi guys, how u doing? I'd like to know if is that a dream work with c# when we talk about 2GB of text files or more? Should i be thinking in others possibilities?
 
Hi, and welcome to the forums.

Benefit of doubt been given here with your post. I understand that English may not be your primary language, so I propose using Google Translator - and I ask that you write your question out in your own language and convert it into English and post the English version here so we can understand what you just wrote. Because the above seems like gibberish and makes no sense. Please ask a valid question, and show what you tried.
 
I'm hoping he'll come back with another phrasing of his question. Right now it feels like he is asking if it possible for C# to handle a 2GB text file, or if it is just wishful thinking. And if it is just wishful thinking, what other options does he have.

Anyway, assuming if the question is whether C# can handle a 2GB or bigger text file, it really depends.

If the intent is to append to a 2GB or larger text file, that should work.

If the intent is to read in a 2GB or larger text file as a stream or a line at time, that should also work.

If the intent is to read in the 2GB or larger text file as one big block of bytes, be aware that the .NET Framework has a 2GB limit for a single array or block of memory.

If the intent is it to randomly seek with a file that is larger than 2GB, it'll depend on whether you are using the Stream or the BinaryWriter. The former supports uses long for seek offsets, while the latter does not.
 
Back
Top Bottom