Imp3rial Posted June 10, 2009 Share Posted June 10, 2009 How to find a text in another text and line of text EX : text is aaaaa bbbbb cccccc ddddd eeeee and i want to find eeeee and the program say : exist on line 5 Link to comment Share on other sites More sharing options...
SandelPerieanu Posted June 10, 2009 Share Posted June 10, 2009 $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 More sharing options...
BrettF Posted June 10, 2009 Share Posted June 10, 2009 (edited) Welcome, StringSplit For...To...Next If...Then...EndIf StringInStr Should get you started Check the helpfile up for them. Cheers, Brett Edited June 10, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
JackDinn Posted June 10, 2009 Share Posted June 10, 2009 $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 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now