anybastard Posted April 15, 2011 Share Posted April 15, 2011 Hi guys , i need your help to finish my tool .My tool generare a txt file ( eg . pippo.txt ) This is my txt file for example value 1 : 123aBc123vaue 2: 345Def345value 3: 678ghI678Test Test : 123456Value 4: abcdefghValue 5: ghl12345kkklI need to view in a message box the value present in "123456 " position More info Test Test : this part is a costant 123456 : is a numeric value only six element Can you give me advice or suggest a code to view this value ?Thanks so much for you help Rgs AnyB. Link to comment Share on other sites More sharing options...
wakillon Posted April 15, 2011 Share Posted April 15, 2011 ??? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
UEZ Posted April 15, 2011 Share Posted April 15, 2011 Try this: $pippo = "value 1 : 123aBc123" & @LF & _ "vaue 2: 345Def345" & @LF & _ "value 3: 678ghI678" & @LF & @LF & _ "Test Test : 123456" & @LF & @LF & _ "Value 4: abcdefgh" & @LF & _ "Value 5: ghl12345kkkl" $array = StringRegExp($pippo, "Test.*\s(\d+)", 3) MsgBox(0, "Test", $array[0]) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
anybastard Posted April 15, 2011 Author Share Posted April 15, 2011 (edited) Hi to both @ UEZ Your code works fine ..but the problem is that my file is very long and not with constant value This mean that for me this part is hard $pippo = "value 1 : 123aBc123" & @LF & _ "vaue 2: 345Def345" & @LF & _ "value 3: 678ghI678" & @LF & @LF & _ "Test Test : 123456" & @LF & @LF & _ "Value 4: abcdefgh" & @LF & _ "Value 5: ghl12345kkkl" Thanks again for your prompt replay BR AnyB Edited April 15, 2011 by anybastard Link to comment Share on other sites More sharing options...
UEZ Posted April 15, 2011 Share Posted April 15, 2011 $pippo = FileRead("Pippo.txt") $array = StringRegExp($pippo, "Test.*\s(\d+)", 3) MsgBox(0, "Test", $array[0]) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
sahsanu Posted April 15, 2011 Share Posted April 15, 2011 @ UEZ Your code works fine ..but the problem is that my file is very long and not with constant valueWell, UEZ just used that as an example. Take a look to FileRead function. Link to comment Share on other sites More sharing options...
anybastard Posted April 16, 2011 Author Share Posted April 16, 2011 Hi Guys , wow...now all work fine !!! Thanks so much for your prompt help Regards An1B 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