-
[C#]Big text files
Hey all,
I've got this text file which is over 2500 lines, but when I do:
PHP Code:
using System;
using System.Text;
using System.IO;
class NPC
{
static void Main()
{
StreamReader SW = new StreamReader("npcs.txt"); //Has 2500+ lines
string read = SW.ReadToEnd();
Console.WriteLine(read);
Console.ReadLine();
}
}
It gives me line 2404 to 3632 (it skips lines 2900 to 3150, and 3375 to 3600).
Why doesn't it show more?
I've tried splitting the lines over 4 text files but then it won't compile at all.
What to do? :(:
-
Re: [C#]Big text files
I really need help with this.. nobody knows..?
-
Re: [C#]Big text files
Well.. the problems not code related since the code below works quite fine. What else could be causing the problem, I have no idea.
PHP Code:
using System;
using System.IO;
using System.Text;
class Program
{
static void Main(string[] args)
{
StreamReader SW = new StreamReader("bigfile.txt"); //Has 6000+ lines
string read = SW.ReadToEnd();
Console.WriteLine(read);
Console.ReadLine();
}
}
-
Re: [C#]Big text files
My guess is that the console can show max. 1000 lines or something
-
Re: [C#]Big text files
try put the text in RichTextBox and replace the end string("\0") with nothing
so it will look like this
Code:
StreamReader SW = new StreamReader ("bigfile.txt"); //Has 6000+ lines
string read = SW.ReadToEnd();
read = read.Replace("\0", "");
RichTextBox.Text = read;