Jump to content

Find String in txt file


Recommended Posts

Hi,

I am trying to find the string "Cert1" in a txt file and if found display a message and if not found display a message but i'm stuck.

Local $CertLog = @ScriptDir & "\CompCertChk.txt"
Local $hFileOpen = FileOpen($CertLog, 0)
Local $Content = FileRead($hFileOpen)
FileClose($hFileOpen)
Local $aString = StringRegExp($Content, "Cert1", 0, "")
If @error = "1" Then
    MsgBox("", "", "Cert is installed")
    Exit
Else
    If @error = "0" Then
        MsgBox("", "", "Cert is NOT installed")
        Exit (63)
    EndIf
EndIf

 

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...