title: vb.net 2013 - removing blank lines with streamreader
body: <p>I am using this code snippet (found on here) to read a csv file into an array.</p>
  
  <pre><code>sFile = "c:\test.txt"
  Dim sData() As String
  Dim arrName, arrValue as New List(Of String)()
  
  Using sr As New StreamReader(sFile)
      While Not sr.EndOfStream
          sData = sr.ReadLine().Split(","c)
  
          arrName.Add(sData(0).Trim())
          arrValue.Add(sData(1).Trim())
      End While
  End Using
  </code></pre>
  
  <p>My source file contains 2 - 3 blank lines at the end of the file.
  Despite using Trim() - I am still getting these blank lines inserted into the array, and this is causing the rest of my code to fail.</p>
  
  <p>I have verified that it works by deleting the blank lines.</p>
  
  <p>I have tried various techniques found on here and on MSDN but I just can't seem to get rid of these blank lines.</p>
  
  <p>Can anyone help please?</p>
  
  <p>Thanks.</p>