The following code opens up a file and after confirming the "MR" opens up a second file and moves data in 80 character sections from one to the other. The problem is the file is one long string of data without carriage returns thus I am at the end of the file after the Line Input statement. My question, How do I go back to the beginning of the record or file so I can load the sections. Do I have to close the file then open it up again? Thanks
Do While (Len(strFile) > 0)
Open strFolderName & "\" & strFile For Binary As #1
Line Input #1, str1
strAppId = Mid(str1, 91, 2)
If strAppId = "MR" Then
Open Results For Output As #2
Dim MyRecord As String
'Sets variable MyRecord to first 80 characters of string.
MyRecord = String(80, " ")
'
Do While Not EOF(1)
Get #1, , MyRecord 'Reads first 80 charcters.
Print #2, MyRecord 'Prints MyRecord(first 80 characters) into file Results #2
Loop
Close #1
Close #2
End If
strFile = Dir
Loop
Do While (Len(strFile) > 0)
Open strFolderName & "\" & strFile For Binary As #1
Line Input #1, str1
strAppId = Mid(str1, 91, 2)
If strAppId = "MR" Then
Open Results For Output As #2
Dim MyRecord As String
'Sets variable MyRecord to first 80 characters of string.
MyRecord = String(80, " ")
'
Do While Not EOF(1)
Get #1, , MyRecord 'Reads first 80 charcters.
Print #2, MyRecord 'Prints MyRecord(first 80 characters) into file Results #2
Loop
Close #1
Close #2
End If
strFile = Dir
Loop