title: Exclude last line from StreamReader in C#
body: <p>I'm saving some DataGridView's data into a text file(for data I'm refering to the content of each cell), and at the last line of the TXT File, I am storing the number of rows of the dataGridView with a "-" at the start of the line.</p>
  
  <p>Now, I can read my data perfectly into my DVG, but how can I exclude the last line which contains my row count and also use it to read its stored int?</p>
  
  <p>The code I use for reading the data into the DVG:</p>
  
  <pre><code>void LoadDVGData()
      {
          StreamReader sr = new StreamReader(open.FileName);
          foreach (DataGridViewRow row in editDGV.Rows)
          {
              foreach (DataGridViewCell cell in row.Cells)
              {
                  string content = sr.ReadLine();
                  cell.Value = content;
              }
          }
          sr.Close();
      }
  </code></pre>
  
  <p>Thanks in Advance. - CCB</p>