Jump to content

snow day


Recommended Posts

well im trying to make a program that searches our school website under a certain page and checks if there are cancellations. I have it setup so it will download the page as a .txt but i dont know how to search the file for a particular word(s) and need to be able to. Any ideas?

Link to comment
Share on other sites

Here you go.

Edit:

- Forgot error checking.

If FoundInFile("test.txt", "James") Then
   MsgBox(64, "Test", "Yes. The string is found!")
Else
   MsgBox(64, "Test", "No. The string is NOT found!")
EndIf

Func FoundInFile($File, $String)
   Local $Found
   Local $Content
   Local $FileSize
   If NOT FileExists($File) Then Return 0
   $FileSize = FileGetSize($File)
   $Content = FileRead($File, $FileSize)
   $Found = StringInStr($Content, $String)
   $Content = ""
   If $Found Then Return 1
   Return 0
EndFunc
Edited by SlimShady
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...