Dim strLine As String, strItem() As String Dim Ulimit As Double, Llimit As Double, Depth As DoubleUlimit = Val(Text1) Llimit = Val(Text2) Open "C:\data\1.txt" For Input As #1 Open "C:\data\2.txt" For Input As #2 Do Until EOF(1) Line Input #1, strLine Do While Instr(strLine, Space(2)) strLine = Replace(strLine, Space(2), Space(1)) Loop strItem = Split(strLine, Space(1)) If Ubound(strItem) > 4 Then Depth = Val(strItem(0)) If Depth >= Llimit And Depth <= Ulimit Then Print #2, strItem(0) & " " & strItem(3) & " " & strItem(4) & " " & strItem(5) End if End if Loop Close #2 Close #1
Dim Ulimit As Double, Llimit As Double, Depth As DoubleUlimit = Val(Text1)
Llimit = Val(Text2)
Open "C:\data\1.txt" For Input As #1
Open "C:\data\2.txt" For Input As #2
Do Until EOF(1)
Line Input #1, strLine
Do While Instr(strLine, Space(2))
strLine = Replace(strLine, Space(2), Space(1))
Loop
strItem = Split(strLine, Space(1))
If Ubound(strItem) > 4 Then
Depth = Val(strItem(0))
If Depth >= Llimit And Depth <= Ulimit Then
Print #2, strItem(0) & " " & strItem(3) & " " & strItem(4) & " " & strItem(5)
End if
End if
Loop
Close #2
Close #1
导ACCESS看看运行性能如何.
实在不行再换方法不过要是一次性的工作的话, 现成的文本文件, 手工也就几分钟的事.