I'm confused at how you're opening the text file BUT, here is how to use Substring to parse your fixed-format records.
Module Module1
Sub Main()
Dim strData As String = "0300002158A2012010921343" ' sample data
Dim strBarCode As String = strData.Substring(0, 10)
Dim chrTerminal As Char = strData(10)
Dim dtDate As DateTime = DateTime.Parse(
strData.Substring(11, 4) + "-" +
strData.Substring(15, 2) + "-" +
strData.Substring(17, 2))
Dim intDOW As Integer = Integer.Parse(strData.Substring(19, 1))
Dim strTime As String = strData.Substring(20, 4)
End Sub
End Module
thines01
Postaholic
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
I can't open your document. Don't assume everyone has Office 2010. Posting in txt format would be preferable.
Reverend Jim
Posting Shark
1,167 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159