read specific line in text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • voroojak
    New Member
    • Feb 2007
    • 92

    #1

    read specific line in text file

    Hi
    I have a text file that has differnt information

    to be more clear i hav eto say that i have three differnt kind of information.
    the column name for all the information are same but there is number at the top that i can undestand whenere shall it go.
    it looks like some thing like this

    102
    (There are some lines here that i do not need it)
    A B C
    aaa 2 3 5
    bbb 1 4 6
    ccc 3 1 5

    103
    (There are some lines here that i do not need it)
    A B C
    aaa 3 3 7
    bbb 1 2 1
    ccc 4 1 4

    104
    (There are some lines here that i do not need it)
    A B C
    aaa 4 1 5
    bbb 3 1 1
    ccc 2 3 7


    their position in text file are all same.

    thanks alot

    P.S:(TO Killer): I solved that problems for IBM Terminal.
    I did half of the job in marco in the Application and then half with access
    i did a macro that will copy and select and append all the pages in my application and the paste it in a text file in access.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    If you completely solved that ,then why you posted it here ?

    Comment

    • voroojak
      New Member
      • Feb 2007
      • 92

      #3
      this is another problem. now i have problem with this text file. i said that i soved the problem with the IBM Terminal not textfile.
      now i dont kno whow can i skip those lines that i do not need.

      i would appreciate any help

      Comment

      • voroojak
        New Member
        • Feb 2007
        • 92

        #4
        maybe i have to explain more

        in my textfile i hav e3 differnt information that according to the information it has to go and sit in differnt table.

        as i said the coulmn name is same for all and the position.
        just if at the top it is 102 then it is for table 103 and 103 for 103 and .....

        i dont know how can i read the lines i want. and skip the lines that i do not want.

        thanks

        Comment

        • bxscikid
          New Member
          • Dec 2007
          • 2

          #5
          You need to add the items in your textfile into an array. Once the array is filled, you can call a specific part of the array using
          Code:
          Myarray(indexnumber)

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by bxscikid
            You need to add the items in your textfile into an array. Once the array is filled, you can call a specific part of the array using
            Code:
            Myarray(indexnumber)
            Surely if you only want particular lines form the file, you would simply read the file line by line and only process the ones you want. Like...

            Code:
            Open File
            Do Until EOF
              Read line from file
              If line matches what I want ("102" or whatever) Then
                Process this line
              End If
            Loop

            Comment

            • voroojak
              New Member
              • Feb 2007
              • 92

              #7
              Hi
              thanks for the solution.

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Originally posted by voroojak
                thanks for the solution.
                Glad we could help. :)

                Comment

                Working...