read fast txt line by lkine

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sal21
    New Member
    • Jun 2006
    • 27

    read fast txt line by lkine

    Sorry for my bad english:-)
    i need to read txt file line by line with best fsted method...

    my txt file is 142 Mb and contain approx 1.370.000 lines...
    all lines have a fixed lenght 132 characters.

    How to?
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #2
    sal21,

    What have you tried so far? This will give us a starting point to troubleshoot your work. We will not design the project for you.

    Thanks.

    Comment

    • sal21
      New Member
      • Jun 2006
      • 27

      #3
      simply:
      Private Sub ReadLines()
      Dim MyLine As String
      Open "C:\MyFile. txt" For Input As #1
      Do While Not EOF(1)
      Line Input #1, MyLine
      MsgBox MyLine
      Loop
      Close #1
      End Sub

      Comment

      • sal21
        New Member
        • Jun 2006
        • 27

        #4
        simply:
        Private Sub ReadLines()
        Dim MyLine As String
        Open "C:\MyFile. txt" For Input As #1
        Do While Not EOF(1)
        Line Input #1, MyLine
        MsgBox MyLine
        Loop
        Close #1
        End Sub

        Comment

        • sal21
          New Member
          • Jun 2006
          • 27

          #5
          imply:
          Private Sub ReadLines()
          Dim MyLine As String
          Open "C:\MyFile. txt" For Input As #1
          Do While Not EOF(1)
          Line Input #1, MyLine
          MsgBox MyLine
          Loop
          Close #1
          End Sub

          Comment

          • hupiyingwu
            New Member
            • Feb 2018
            • 2

            #6
            I like writing like this.
            open file for input as #1
            input #1,a
            close #1
            c=1
            while c=1
            on error goto e
            msgbox split(a,vbcrlf) (c)
            c=c+1
            wend
            e:
            msgbox "end"

            Comment

            • sal21
              New Member
              • Jun 2006
              • 27

              #7
              i'm not sure yuor code work....

              Comment

              Working...