To acomplish your goal you need to do two steps:
- Read the entire file.
- Transform to appropiate structure.
Thanks to LINQ you can accomplish quickly:
var cells = (from l in System.IO.File.ReadAllLines("myfile.txt")
select l.Split(" ".ToArray(), StringSplitOptions.RemoveEmptyEntries)).ToArray();
Now you can access the cells like this:
var value = cells[1][2];
3
solved C# Readint a txt file and creating an exact copy of it inside a program