Advertisement
6_2008-2009 Microsoft Office Apps/VBA #216274

Read a text file line by line

Purpose is to open up a text file and read the contents line by line.

AI

Ringkasan AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kode Sumber
original-source
Sub ReadLineByLine()
' Variable Declarations
Dim folderName As String
Dim fileName As String
folderName = "C:\Dump\"
fileName = "test.txt"
Open folderName & fileName For Input As #1
Do While Not EOF(1)
 Line Input #1, inputdata
 MsgBox inputdata
Loop
Close #1
End Sub
Komentar Asli (3)
Dipulihkan dari Wayback Machine