Kreatorul Posted February 26, 2008 Posted February 26, 2008 I want to search a text/html document for a given string and in return I want to see the line number of where the string is located. Like $search=FileSearch("autoit", "c:/games/blahblah.txt") and then MsgBox("Autoit", "Autoit was found in line $search"). Maybe there's a function like that in autoit and I couldn't find it and searching the forums doesn't return exact results.
therks Posted February 26, 2008 Posted February 26, 2008 What you'll need: [*] FileOpen [*] FileRead [*] StringInStr and/or StringRegExp Then some way to determine which line it's on. I'd try something like this $chunk = StringLeft($fileContents, $stringFound) StringReplace($chunk, @LF, '') $lineFound = @extended My AutoIt Stuff | My Github
therks Posted March 1, 2008 Posted March 1, 2008 Gee, glad I could help... My AutoIt Stuff | My Github
weaponx Posted March 1, 2008 Posted March 1, 2008 Gee, glad I could help...You didn't get a response due to the banning:#484694
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