nill Posted June 21, 2023 Share Posted June 21, 2023 (edited) Using $text = StdoutRead($_plinkhandle) I get the text from the console like this echo $? 0 How can I process this text in autoit to read what value comes after $? ignoring the line feed ? Edited June 21, 2023 by nill Link to comment Share on other sites More sharing options...
Solution Andreik Posted June 21, 2023 Solution Share Posted June 21, 2023 Something like this? #include <Array.au3> $sData = 'echo $? whatever data is here' & @LF & '0' $aMatches = StringRegExp($sData, 'echo \$\?(.+)', 3) _ArrayDisplay($aMatches) nill 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
nill Posted June 21, 2023 Author Share Posted June 21, 2023 7 hours ago, Andreik said: Something like this? #include <Array.au3> $sData = 'echo $? whatever data is here' & @LF & '0' $aMatches = StringRegExp($sData, 'echo \$\?(.+)', 3) _ArrayDisplay($aMatches) It doesn't work or I don't understand something I got $aMatches=1 Not array Link to comment Share on other sites More sharing options...
Andreik Posted June 21, 2023 Share Posted June 21, 2023 1 hour ago, nill said: It doesn't work or I don't understand something I got $aMatches=1 Not array In the example above result of $aMatches is definitely not 1. Show me what you run when you got this result. nill 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
nill Posted June 21, 2023 Author Share Posted June 21, 2023 Yea you are right I used another string for checking Link to comment Share on other sites More sharing options...
Andreik Posted June 21, 2023 Share Posted June 21, 2023 It happens sometime. Glad you found the answer. When the words fail... music speaks. 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