tAKTelapis Posted July 26, 2006 Share Posted July 26, 2006 well, ive been working on this for near 3 hours. (i know its sloppy, but im just starting out with autoIT)ive viewed all of the help topics etc, so far, i havent managed to get it to work.i used the expressions checker included with the help file in the BETA to get the expression right. but i cant get my script to function.here is my script:$file = FileOpen("c:\Test.txt", 0) While 1 $Line = FileReadLine($file) If @error = -1 Then ExitLoop $var = StringRegExp($Line, (<a href="/cartoons/\?id=19971117">), 0) ; i think something is missing here, some kind of if...endif statement? (comment only added for forums.) MsgBox(0, "New Message", $var&" The line was found") Wendi read something in the script about not scanning lines in this manner, as it is cpu hungy.eventually, when i find the line, i want to bring the ENTIRE line into a variable for use, i havent looked into doing this yet, so i figured i would ask.anyways. any help appreciated./tAK Link to comment Share on other sites More sharing options...
Briegel Posted July 26, 2006 Share Posted July 26, 2006 (edited) Try this line in ypour script.$var = StringRegExp($Line, ('<a href="/cartoons/\?id=19971117">'), 0)oÝ÷ Øêæk&Þjëh×6$var = StringRegExp($Line, '(<a href="/cartoons/\?id=19971117">)', 0) Edited July 26, 2006 by Briegel Link to comment Share on other sites More sharing options...
tAKTelapis Posted July 26, 2006 Author Share Posted July 26, 2006 wikid. thanks briegel. didnt think id get a response that fast. it finds what im after. any ideas on making it identify the line number it was found on, and the Character number of the first character? i do realise that the piece of code in its current state doesnt actually complete, and that the OK prompt just keeps coming, however this is not important at this time. Cheers /tAK Link to comment Share on other sites More sharing options...
Briegel Posted July 26, 2006 Share Posted July 26, 2006 wikid. thanks briegel. didnt think id get a response that fast. it finds what im after. any ideas on making it identify the line number it was found on, and the Character number of the first character? i do realise that the piece of code in its current state doesnt actually complete, and that the OK prompt just keeps coming, however this is not important at this time. Cheers /tAK$file = FileOpen("c:\Test.txt", 0) $i = 1 ; count the lines While 1 $Line = FileReadLine($file) If @error = -1 Then ExitLoop $var = StringRegExp($Line, ('<a href="/cartoons/\?id=19971117">'), 0) MsgBox(0, "New Message", $var&" Was found at Line " & $i ) If $var = 1 Then ExitLoop $i += 1 WEnd Sorry I don't understand 'the Character number of the first character'. Link to comment Share on other sites More sharing options...
tAKTelapis Posted July 26, 2006 Author Share Posted July 26, 2006 (edited) thankyou very much for all of your help, my script is now complete. thanks again. /tAK ps: happy SAAD for tomorrow to all other sys admins out there Edited July 27, 2006 by tAKTelapis 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