Results 1 to 2 of 2

Thread: Reading a File and Compare each line

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482

    Question

    Hey, is there a way i could open a TEXT FILE
    and COMPARE each line with something else...

    Example:

    CText = "Hey There"

    File:

    Yo
    What Up
    Hey There <----compares to EACH line and finds this one
    Whats New

    so it will compare itself to EACH line of a text file.. if a match is found.. it will do something.. if not it'll do something else


    THANKS

  2. #2
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    I had to something similar for a kind if dictionary I had to create. What I had to do was loop through each line in a file and compare it using strComp(Str1, str2, vbTextCompare).

    Returns:

    string1 is less than string2 -1
    string1 is equal to string2 0
    string1 is greater than string2 1
    string1 or string2 is Null Null

    I used
    str1 = object.readline (from the TextStream Object Model)and str2 = MyString.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width