O
Ogier
I have a text file containing the following four lines:
This line has no commas.
However, this one has
But, alas, the line is read in pieces
Characters: ;_.+"%&!,,,
If I try to read it with the following sub
Private Sub ReadTextFile()
Dim FileName As String
Dim Line As String
FileName = "Y:\TestTextWithCommas.txt"
Open FileName For Input As #1
Do Until EOF(1)
Input #1, Line
Debug.Print Line
Loop
Close #1
End Sub
The result in the Immediate window is this:
This line has no commas.
However
this one has
But
alas
the line is read in pieces
Characters: ;_.+"%&!
[Three empty lines follow]
What is the reason for this strange behavior and how do I avoid it?
Best wishes
Holger Nielsen
This line has no commas.
However, this one has
But, alas, the line is read in pieces
Characters: ;_.+"%&!,,,
If I try to read it with the following sub
Private Sub ReadTextFile()
Dim FileName As String
Dim Line As String
FileName = "Y:\TestTextWithCommas.txt"
Open FileName For Input As #1
Do Until EOF(1)
Input #1, Line
Debug.Print Line
Loop
Close #1
End Sub
The result in the Immediate window is this:
This line has no commas.
However
this one has
But
alas
the line is read in pieces
Characters: ;_.+"%&!
[Three empty lines follow]
What is the reason for this strange behavior and how do I avoid it?
Best wishes
Holger Nielsen