pheaphae Posted July 20, 2008 Posted July 20, 2008 (edited) hello, i need to get some text from a larger file. let's say we haveCODEblahblah lll ddd <a>texttexttext<b> aofawc2cfrom this, i want to get only texttexttext in a variable. how should i do it? thanks! Edited July 20, 2008 by pheaphae
Artisan Posted July 20, 2008 Posted July 20, 2008 (edited) You could use a For ... Next loop to scan for the start and end markers, then parse the data out. Alternatively, you can use StringRegExp. It's a cleaner solution, but more confusing unless you know what you're doing. Here's how it might look: Dim $input = "blahblah lll ddd <a>texttexttext<b> aofawc2c" Dim $output = Parse($input) MsgBox(0, "Results", $output[0]) Func Parse ( Const $text ) Return StringRegExp($text, "<a>(.*)<b>", 1) EndFunc EDIT: Whatever you choose, make sure to thoroughly research your choice in the AutoIt help files. You need to understand the code you're using, or you'll have nothing but headaches. Edited July 20, 2008 by Artisan
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