Jump to content

autoit search


Recommended Posts

$text_to_search = 'eeee'
$text = 'aaaa' & @CRLF & _
      'bbbb' & @CRLF & _
      'cccc' & @CRLF & _
      'dddd' & @CRLF & _
      'eeee'
$text_split = StringSplit($text, @CRLF, 1)
For $idx = 1 To $text_split[0]
   If StringInStr($text_split[$idx], $text_to_search, 0, 1) > 0 Then
      MsgBox(262144, '', $text_to_search & @CRLF & ' found on line ' & $idx)
   EndIf
Next

I hope this help you...

Link to comment
Share on other sites

Welcome,

StringSplit

For...To...Next

If...Then...EndIf

StringInStr

Should get you started :D

Check the helpfile up for them.

Cheers,

Brett

Edited by BrettF
Link to comment
Share on other sites

$string = "hefhfehfh  ruohr" & @CRLF & "rufuheyf"
$capture = "he"
$split = StringSplit($string, @CRLF, 1)
For $count = 1 To $split[0]
    If StringInStr($split[$count], $capture) Then
        MsgBox(0, '', $capture & " found at " & $count)
    EndIf
Next

hi, and welcome :D

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

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