I have tried to read from text a list of integer into jagged array (because its every row contains different number of elements separated by space) but i face System.NullReferenceException on this block of code:
integers [counter] [n] = int.Parse (split[n]);
The whole code:
int[][] integers = new int[200][];
int[][] tmp = new int[1][];
int n = 0;
int counter = 0;
string[] file = File.ReadAllLines(@"C:\1.txt");
foreach (string line in file) {
string [] split = line.Split(new Char [] {' ', ',', '.', ':', '\t' });
foreach (string s in split) {
if (s.Trim () != " ") {
integers [counter] [n] = int.Parse (split[n]);
n++;
}
}
counter++;
}