Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/06/2013, 10:50
Avatar de Namiwis
Namiwis
 
Fecha de Ingreso: mayo-2013
Ubicación: Crustaceo Cascarudo
Mensajes: 162
Antigüedad: 11 años
Puntos: 10
Respuesta: leer ultimas 5 lineas de un txt

Código:
Dim TXT_Parseado As New List(Of String)()

'Leo el archivo TXT desde su origen.
Dim Sr As New StreamReader("RutadelTXT", Encoding.[Default])

'Vacio el vector.
TXT_Parseado.Clear()

'Leo linea por linea para meterlo al vector que contenera el TXT
Do
	'Leo la Linea
	sLine = Sr.ReadLine()
	If (sLine IsNot Nothing) Then
		'Agrego los valores al vector.
		TXT_Parseado.Add(sLine.Trim())
	End If
Loop While Not (sLine Is Nothing)
'Cierro el objeto.
Sr.Close()

Con eso ya tienes el TXT en un Vector TXT_Parseado, ahora solo Lee las ultimas Lineas

Algo como esto.

Tuvariable = TXT_Parseado(TXT_Parseado.Count - 1).ToString()
Tuvariable = TXT_Parseado(TXT_Parseado.Count - 2).ToString()
Tuvariable = TXT_Parseado(TXT_Parseado.Count - 3).ToString()
Tuvariable = TXT_Parseado(TXT_Parseado.Count - 4).ToString()
Tuvariable = TXT_Parseado(TXT_Parseado.Count - 5).ToString()
Espero te sirva