Andrew
unread,Sep 3, 2008, 1:23:22 PM9/3/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi all, I am trying to read a text like file that is padded with some
garbage (or at least it is to me). When I try to read using
StreamReader it does not make it past the first few awkward
characters, can anyone suggest a method to read in this data? Simply
ignoring it is a acceptable solution, as the end result is to filter
this out.
This is an example of what the input is like, everything before the
0H## is garbage, but using StreamReader it does not get past them.
µ á 0H12$HEHDT,224.71,T*1D
É á 0H14$WIMWV,009,R,023,N,A*2B
É á 0H15$VMVLW,301074.5,N,0296833,N*79
Ý á 0H23$AGHTD,V,3.9,R,R,N,10,10,0.5,10.0,,0.0,,T,A,A,A,224.7*6C
Ý á 0H12$HCHDM,232.90,M*13
Here is the implementation of the code. Currently just dumps what is
read into a text box as proof of concept.
myStream = opnFile.OpenFile()
If (myStream IsNot Nothing) Then
Dim objReader As New
StreamReader(opnFile.FileName)
txtOut.Text = objReader.ReadToEnd
objReader.Close()
'Read stream
End If
Any help greatly appreciated.
Cheers and thanks.