Visual Basic.NET - StreamReader

 
Vista:

StreamReader

Publicado por HIXEM (178 intervenciones) el 27/01/2005 15:10:07
Tengo en un HTM los datos (en formato plano) de unos pacientes que suman en total 243 registros (243 pacientes)
Los exoprto a formato TXT con el streamwriter para poder extraer retgistro por registro e introducirlos en base datos.
Todo bien hasta aqui.
Pero cuando me escribe el format texto (txt) solo escribe 241 registros (me faltan 2 registros)
¿ por que? ¿como soluciono esto?
Aqui envio el código:

DOCUMENTO = "C:\datos\paciente.htm"
If System.IO.File.Exists(DOCUMENTO) Then
Dim sw As StreamWriter = New StreamWriter("C:\datos\paciente.txt", FileMode.CreateNew)
Dim SR As StreamReader
Dim FS As FileStream
FS = New FileStream(DOCUMENTO, FileMode.Open)
SR = New StreamReader(FS)
Dim texto As Object
texto = SR.ReadToEnd
sw.Write(texto)
else
MessageBox.Show("El documento no existe.... DEBE GENERARLO PRIMERO", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
endif

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder