CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 1999
    Posts
    14

    Urgent! How to find a word in html or text files?

    How to find a word in html or text file


  2. #2
    Join Date
    Jan 2000
    Location
    CA
    Posts
    52

    Re: Urgent! How to find a word in html or text files?

    Usually you can use the INSTR (In String) function to locate a specific string, including entire words or phrases.


  3. #3
    Guest

    Re: Urgent! How to find a word in html or text files?

    The best way to do this is to load the entire file into a variable and the search the string for whatever word you want
    ie.

    Open "test.html" for binary as #1
    holdstring = input$(LOF(1), 1)
    If InStr(1, holdstring, "myword")then
    MsgBox "Found Word"
    else: MsgBox "Couldn't Find It"
    End If
    Close #1



    just make sure that you give the full filename and path for the file when you open it.
    Hope this is of some help.


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

Featured