1:首先去读文件.文件里面的数据是
^[1;3H1
^[2;3H2
^[4;3H4
^[5;3H5
^[6;3H6
^[7;3H7
^[8;3H8
^[9;3H9
^[10;2H10
^[11;2H11
^[17;2H17
^[18;2H18
^[19;2H19
^[20;2H20)
****[1
    [2
    [3
     等等!1,2,3...代表的是行数,
****H1
    H2
    H3
     等等!1,2,3...代表的是值
程序运行的时候窗体中打印出 1 ,2 ,3 但是这个值是按行走的!
  效果应该是:
     1
     2
     3
     
     4
     5
     
     
    17
    18
    19
    20
 谢谢了! 这些值是H后面的值

解决方案 »

  1.   

    Private Sub Command1_Click()
        Dim strm As TextStream
        Dim fs As New FileSystemObject
        Dim sTmp As String
        Dim fl As File
        Set fl = fs.GetFile("D:\AA.txt")
        Set strm = fl.OpenAsTextStream(ForReading)
        s = 1
        Do While strm.AtEndOfLine = False
            sTmp = strm.ReadLine
            sTmp = Mid(sTmp, 3)
            h = Val(sTmp)
            v = Mid(sTmp, InStr(sTmp, "H") + 1)
            Do While h > s
                Print ""
                s = s + 1
            Loop
            Print v
            s = s + 1
        Loop
        strm.Close
    End Sub
      

  2.   


      Dim fName As String
      Dim str As String
        
        fName = App.Path & "\test.txt"    Open fName For Input As #1
        Do While Not EOF(1)
            Line Input #1, str
            Debug.Print Val(Split(str, "H")(1))
        Loop
        Close #1