title: reading from a text file into a jagged array
body: <p>I found this question in an old question in your website so i thought i can do it but I think I was mistaken :-)</p>
  
  <p>the old post was <a href="https://stackoverflow.com/questions/360943/read-text-from-file-and-apply-some-operations-on-it">here</a></p>
  
  <p>I'm new at the jagged array thing so did the following code</p>
  
  <pre><code>StreamReader rows = new StreamReader("c:\\practice.txt");
              string line;
              int i;
              i=1;
              while ((line = rows.ReadLine()) != null)
              {
                  String[][]rows = new String [i][]; ;
                  rows = rows.ReadLine();
                  String[][] rows = new string[S.Length][];
                  i++;
              }
              for (int i; i &lt; S.Length; i++)
              {
  
                  row[i] = S[I].Split(',');
  
              }
  
              int totalCounter = 0, totalSum = 0;
              // etc
              foreach(string[] row in rows)
              {    
                  int m1 = int.Parse(row[3]);
                  totalCounter++;
                  totalSum += m1;
                  switch(row[2])
                  {        
                      case "male":
                      maleCount++;            
                      maleSum += m1;            
                          break;        
                      case "female":            
                          femaleCount++;            
                          femaleSum += m1;            
                          break;    
                  }
              }
  </code></pre>
  
  <p>I know i did major mistakes but at east i tried can any one help me to make it a workin code </p>