如何用VB编一个能从文本文档中提取其中数据的程序?新手请教
如题
请说具体点,要举个例子,请看下面要得不?
Public Function Txt(FName As String) As String
Dim i As Integer
Dim a, b
Open App.Path & "\" & FName For Binary As #1
a = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
Txt = a
End Function
Public Function TxtLine(FName As String) As String
Dim tmp As String
Open App.Path & "\" & FName For Input As #1
Do While Not EOF(1)
Line Input #1, tmp
TxtLine = TxtLine & tmp & ","
Loop
TxtLine = Mid(TxtLine, 1, Len(TxtLine) - 1)
Close #1
End Function