title: C# Need help to read text file to 2D or jagged array
body: <p>I'am working with SMACOF algorythm and have a little problem. I'am trying to read text file wich contains elements like this:</p>
  
  <pre><code>5.1 3.5 1.4 0.2 
  4.9 3.0 1.4 0.2 
  4.7 3.2 1.3 0.2 
  4.6 3.1 1.5 0.2
  </code></pre>
  
  <p>Where are few hundred lines of these elements. So far I have managed to read just first line and don't know why it's not reading all lines. Here is my code:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          string[] lines = File.ReadAllLines("duom.txt");
          string[][] grid = new string[lines.Length][];
          for (int i = 0; i &lt; lines.Length; i++)
          {
              grid[i] = lines[i].Split(',');
          }
          for (int i = 0; i &lt; lines.Length; i++)
          {
              for (int j = 0; j &lt; lines[i].Length; j++)
              {
                  Console.WriteLine(grid[i][j]);
                  Console.ReadLine();
              }
          }
      }
  </code></pre>
  
  <p>So, maybe you guys can explain what is wrong with my code, and how propely read text file? Thanks.</p>