I have a file with array of values as
0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0
I need to read that file and get the value of each row and column and store it in a string[,] or int[,] currently I am trying to achieve this like this but not working .Any advice is appreciated
using (StreamReader reader = new StreamReader(File.Open(Filename, FileMode.Open))){
string line;
string[] columns;
while ((line = reader.ReadLine()) != null)
{
int r, c;
for (r = 0; r <= 599; r++)
{
for (c = 0; c <= 599; c++)
{
columns = line.Split(' ');
foreach (string value in columns)
{
if (value != "")
{
Cycles[r, c] = value;
}
}
}
}
}
}
sudhansh