'txt原始数据与运行后验证情况如上图,代码如下,需要仔细研究下
Private Sub Command3_Click()
Dim hang() As String
Dim lie() As String
Dim zhuge() As String
Dim i, a, b, c, j As Integer
c = 1
Open "d:\test.txt" For Input As #1
While Not EOF(1)
ReDim Preserve hang(i)
Line Input #1, hang(i)
i = i + 1
Wend
Close #1
For a = 0 To UBound(hang)
lie = Split(hang(a), " ")
For b = 0 To UBound(lie)
ReDim Preserve zhuge(c)
zhuge(c) = lie(b)
c = c + 1
Next b
Next a
For j = 1 To UBound(zhuge) '打印验证
Print zhuge(j)
Next j
End Sub