title: Importing last line of a .csv file
body: <p>I have a csv file and I need to get the last line only into seperate textboxes.</p>
  
  <pre><code>Imports System.IO
  
  Public Class Form1
  
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      End Sub
  
      Private Sub btnConditions_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConditions.Click
          Using reader As New StreamReader("C:\temp\Apr12log.txt")
              Dim line As String = reader.ReadLine()
  
  
              Dim fields() As String = line.Split(",".ToCharArray())
              Dim fileDate = CDate(fields(0))
              Dim fileTime = fields(1)
              Dim fileTemp = fields(2)
              Dim fileHum = fields(3)
              Dim fileWindSpeed = fields(4)
              Dim fileWindGust = fields(5)
              Dim fileWindBearing = fields(6)
  
              While line IsNot Nothing
  
                  line = reader.ReadLine()
              End While
              txtDate.Text = CStr(fileDate)
          End Using
  
      End Sub
  
  End Class
  </code></pre>
  
  <p>It only inputs the first line I am not sure how to get the last line only.</p>
  
  <p>example of txtfile</p>
  
  <pre><code>01/04/12,00:00,5.4,80,3.0,4.5,9.6,261,0.0,0.0,1025.0,1.0,16.8,43,4.0,3.8,5.4,0.0,0,0.0
  </code></pre>