Lisa,
the following seems best to me if I understand what you want to do.
Assuming that you have a text file, each line having a CR/LF (newline) at
the end and wanting to get chars 26-37
The following will do that.
HTH,
Shane
'read and process txt file one line at a time
Public Sub ReadFromFile(ByVal strTextFilePath As String)
Dim strmInfile As New System.IO.StreamReader(strTextFilePath)
dim strLine as string
dim S as string
Me.Cursor.Current = Cursors.WaitCursor
'read line
strLine = strmInfile.ReadLine
While Not strLine Is Nothing
Try
s=strLine.substring(25,11) 'read chars 26-37
'YOU DO SOMETHING WITH S
'get next line
strLine = strmInfile.ReadLine
Catch ex As System.Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "ERROR Reading
file")
Me.Cursor.Current = Cursors.Default
exit Sub
Finally
strmInfile.close
End Try
End While
strmInfile.Close()
Me.Cursor.Current = Cursors.Default
End Sub