anybastard Posted April 15, 2011 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.
wakillon Posted April 15, 2011 Posted April 15, 2011 ??? AutoIt 3.3.18.0 X86 - SciTE 5.5.7 - WIN 11 24H2 X64 - Other Examples Scripts
UEZ Posted April 15, 2011 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
anybastard Posted April 15, 2011 Author 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
UEZ Posted April 15, 2011 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
sahsanu Posted April 15, 2011 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.
anybastard Posted April 16, 2011 Author Posted April 16, 2011 Hi Guys , wow...now all work fine !!! Thanks so much for your prompt help Regards An1B
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