working with a text file

  • Thread starter Thread starter frank
  • Start date Start date
F

frank

I have a text file that I would like to process line by
line. Some of the text lines has commas in them.
The "Input #1, dataline" is only taking the text up until
the comma is reached and then goes to the next line. How
do I get the whole text line (commas inclueded) into
the "dataline"?

Open FileName For Input As #1
Do While Not EOF(1)
Input #1, dataline
Debug.Print dataline
Loop
Close #1

Thanks in advance
 
frank said:
I have a text file that I would like to process line by
line. Some of the text lines has commas in them.
The "Input #1, dataline" is only taking the text up until
the comma is reached and then goes to the next line. How
do I get the whole text line (commas inclueded) into
the "dataline"?

Open FileName For Input As #1
Do While Not EOF(1)
Input #1, dataline
Debug.Print dataline
Loop
Close #1

Use the Line Input # statement.
 
Back
Top