I am having trouble reading a text file the way I would assume it would be read.
This is my code:
This is the first & only 2 lines of data in the sample test.txt file:
My expected Msgbox output is:
1st Loop through:
2nd Loop through:
...then file closes.
But, this is my actual Msgbox output:
1st Loop through:
2nd Loop through:
3rd Loop through:
4th Loop through:
It is breaking up the first line of data at each coma. How do I get this to give my expected output of only 2 full lines of data?
This is my code:
Code:
Sub test2()
Dim fLine As String
Open "C:\test.txt" For Input As #1
Do While Not EOF(1)
Input #1, fLine
MsgBox fLine
Loop
End Sub
This is the first & only 2 lines of data in the sample test.txt file:
Code:
CLNT=250001,REPORT-DATE=103109,REQUESTD=LAYTONNA
SCH#=0080
My expected Msgbox output is:
1st Loop through:
Code:
CLNT=250001,REPORT-DATE=103109,REQUESTD=LAYTONNA
2nd Loop through:
Code:
SCH#=0080
...then file closes.
But, this is my actual Msgbox output:
1st Loop through:
Code:
CLNT=250001
2nd Loop through:
Code:
REPORT-DATE=103109
3rd Loop through:
Code:
REQUESTD=LAYTONNA
4th Loop through:
Code:
CLNT=250001
It is breaking up the first line of data at each coma. How do I get this to give my expected output of only 2 full lines of data?