hltan
asked on
Print the content of the text file
Hi,
How to print line by line of text file content?
Here is my example. I have one text file called myprofile with 3 line as follow:
line 1 : myname
line 2 : myage
line 3 : mydob
I want the program to read this myprofile.txt and assign line by line to a variable until end of file. Then print out this text file content.
Help please.
Thanks.
How to print line by line of text file content?
Here is my example. I have one text file called myprofile with 3 line as follow:
line 1 : myname
line 2 : myage
line 3 : mydob
I want the program to read this myprofile.txt and assign line by line to a variable until end of file. Then print out this text file content.
Help please.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim sData As String
Dim iFileNum As Integer
iFileNum = FreeFile
sFileName = "C:\gwdbg32.txt"
Open sFileName For Input As iFileNum
Do Until EOF(iFileNum)
Line Input #iFileNum, sData
Printer.Print sData
Loop
Printer.EndDoc