xXx Posted July 18, 2006 Share Posted July 18, 2006 hi its me again :"> is it possible to read only a part from a line of a textfile? like:the file would have this as example:-------------------Line1Line2Line3Line3Line4Line5-i-only-want-to-read-this-in-bold-Line5Line6-------------------so i would like to read only the bolded part....is that possible? is there already a function to make this? Link to comment Share on other sites More sharing options...
nitekram Posted July 18, 2006 Share Posted July 18, 2006 hi its me again :"> is it possible to read only a part from a line of a textfile? like:the file would have this as example:-------------------Line1Line2Line3Line3Line4Line5-i-only-want-to-read-this-in-bold-Line5Line6-------------------so i would like to read only the bolded part....is that possible? is there already a function to make this?How about stringsplit() 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
xXx Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) How about stringsplit()hm but - is not a separator.the line would be like:|6456138 |and i only want to read the numbersso how would i do that with stringsplit? Edited July 18, 2006 by xXx Link to comment Share on other sites More sharing options...
ending Posted July 18, 2006 Share Posted July 18, 2006 (edited) If there is extra spaces, you could check out the ClearWhiteSpace() or something like that, its in the String section. Edited July 18, 2006 by ending Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 18, 2006 Moderators Share Posted July 18, 2006 $sLine = "|6456138 |" $aLineNums = StringRegExp($sLine, "(\d+)", 1) MsgBox(0, "Numbers", $aLineNums[0]) Link to comment Share on other sites More sharing options...
xXx Posted July 18, 2006 Author Share Posted July 18, 2006 $sLine = "|6456138 |" $aLineNums = StringRegExp($sLine, "(\d+)", 1) MsgBox(0, "Numbers", $aLineNums[0])and with this example? i want only that it shows 6A5E1F8 but if i change \d+ to \A+ it will take Hex even if i change to \x+ it will take 01 |Hex 01: 6A5E1F8 | Edit: im searching right now for a fix or the other flags maybe i get one while you're reading this Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 18, 2006 Moderators Share Posted July 18, 2006 and with this example? i want only that it shows 6A5E1F8 but if i change \d+ to \A+ it will take Hex even if i change to \x+ it will take 01 |Hex 01: 6A5E1F8 | Edit: im searching right now for a fix or the other flags maybe i get one while you're reading thisIt would help if you would post exactly what you are wanting to match the first time. $sLine = "|Hex 01: 6A5E1F8 |" $aLineNums = StringRegExp($sLine, "(?:Hex\s\d{2}:\s)(\A+)", 1) MsgBox(0, "Numbers", $aLineNums[0]) Link to comment Share on other sites More sharing options...
ivan Posted July 18, 2006 Share Posted July 18, 2006 It's coming soon! Working on a non edit control do do just that, ALL THANKS TO DALE (IE.au3)! I'll keep you posted, see if I release it in the scripts and scraps. IVAN Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
ivan Posted July 19, 2006 Share Posted July 19, 2006 You might want to take a look at an attempt to get an embedded browser to work as an Edit control explained here:_HyperEditWARNING!!!ONLY ALPHA -1001Not even tested it myself besides what's posted.IVAN Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 19, 2006 Moderators Share Posted July 19, 2006 You might want to take a look at an attempt to get an embedded browser to work as an Edit control explained here:_HyperEditWARNING!!!ONLY ALPHA -1001Not even tested it myself besides what's posted.IVANYour last two post have had nothing to do with this topic. If you are trying to advertise your script, post it in the Scripts and Scraps Forum! Link to comment Share on other sites More sharing options...
xXx Posted July 19, 2006 Author Share Posted July 19, 2006 It would help if you would post exactly what you are wanting to match the first time. $sLine = "|Hex 01: 6A5E1F8 |" $aLineNums = StringRegExp($sLine, "(?:Hex\s\d{2}:\s)(\A+)", 1) MsgBox(0, "Numbers", $aLineNums[0])yes sry first i thought there would be a function like FileReadFromCharToChar or something like that but after u showed me this function i saw that it doesnt work with from to it is working now and i just took again a look to the helpfile to understand what u wrote there... thx for your help 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