working with a text file

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
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top