'定义一计数器来处理不就完了?!
dim nCounter as Long ' 计数器
Dim nFile as integer, strTmp as string
nFile = FreeFile
Open 全路径文件名 For Input As #nFile
Do While Not EOF(nFile)
Line Input #nFile, strTmp 'strtmp为读取的一行字符
nCounter=nCounter+1 'nCounter即第几行
Dim nFile as integer, strTmp as string
nFile = FreeFile
Open 全路径文件名 For Input As #nFile
Do While Not EOF(nFile)
Line Input #nFile, strTmp 'strtmp为读取的一行字符
......
Loop
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' GetLyrics
' Purpose:
' Displays the contents of the lyrics files.
' Demonstrates the following
' - FileSystemObject.OpenTextFile
' - FileSystemObject.GetFile
' - TextStream.ReadAll
' - TextStream.Close
' - File.OpenAsTextStream
' - TextStream.AtEndOfStream
' - TextStream.ReadLine
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function GetLyrics(FSO)
Dim TextStream
Dim S
Dim File
' There are several ways to open a text file, and several
' ways to read the data out of a file. Here's two ways
' to do each:
Set TextStream = FSO.OpenTextFile(TestFilePath & "\Beatles\OctopusGarden.txt", OpenFileForReading)
S = TextStream.ReadAll & NewLine & NewLine
TextStream.Close
Set File = FSO.GetFile(TestFilePath & "\Beatles\BathroomWindow.txt")
Set TextStream = File.OpenAsTextStream(OpenFileForReading)
Do While Not TextStream.AtEndOfStream
S = S & TextStream.ReadLine & NewLine
Loop
TextStream.Close
Dim arrb() as byte,s() as string,i as long
Open "c:\xxx.txt" For Binary As #1
ReDim arrb(LOF(1)) As Byte
Get #1, , arrb
Close 1
erase arrb
s()=split(strconv(arrb,vbunicode),vbcrlf)
for i=0 to ubound(s)
call 相关操作(i)
next
erase s