El 09/01/2013, a las 21:54, Alejandro Nelis escribió:
> Roberto:
> Te recomiendo que mires la librería fule helper que te permite manejar
> archivos de texto de una manera muy intuitiva.
> Saludos.
> Alejandro Nelis
>
> El ene 9, 2013 11:14 a.m., "Tito Molina" <[email protected]> escribió:
> Hola, resulta que quiero recorrer todas las lineas de un archivo de texto.
> Cuando ejecuto el siguiente código me muestra el último
>
> Private Sub btnCargarArchivo_Click(ByVal sender As System.Object, ByVal e
> As System.EventArgs) Handles btnCargarArchivo.Click
> Dim DGBox As New OpenFileDialog
> DGBox.Filter = "Archivos de texto plano (.txt)|*.txt"
> DGBox.Multiselect = False
> DGBox.ShowDialog()
> If DGBox.FileName.Length > 0 Then
> Using Archivo As New System.IO.StreamReader(DGBox.FileName)
> Dim Columna() As String
> While Not Archivo.EndOfStream
> Columna = Archivo.ReadLine.Split(";")
>
> txtCasa.Text = String.Format("{0}", Columna(0))
> txtOficina.Text = String.Format("{0}", Columna(1))
> txtCuenta.Text = String.Format("{0}", Columna(2))
> txtAño.Text = String.Format("{0}", Columna(3))
> txtMes.Text = String.Format("{0}", Columna(4))
> txtImporte.Text = String.Format("{0:C}", Columna(5))
> txtNumeroCuota.Text = String.Format("{0}", Columna(6))
> txtDNI.Text = String.Format("{0}", Columna(7))
> txtReparticion.Text = String.Format("{0}", Columna(8))
> txtBoleta.Text = String.Format("{0}", Columna(9))
> txtAfiliado.Text = String.Format("{0}", Columna(10))
> End While
> End Using
> End If
> End Sub
>
> Me interesaría saber como hacer para leer la primera fila de dicho registro.
> Luego yo me daría maña para leer cualquier fila que es lo que en realidad
> quiero hacer. Muchas gracias
>
> --
> Roberto Miguel Molina