RestrictedUser Posted April 23, 2019 Share Posted April 23, 2019 (edited) Hi AutoIt Scriptwriters! I want to extract my RDPs informations and write in file/console here is my code: $txt = "127.0.0.1:3389@Administrator;12345" & @CRLF & "120.0.0.1:3389@Guest;54321" $ArrayTXT = StringSplit($txt, @CRLF, 3) For $IP In $ArrayTXT $Ex_IPAddress = StringRegExpReplace($IP, ":.*", "") $Ex_IPAddressPort = StringRegExpReplace($IP, "@.*", "") $Ex_DomainUsername = StringRegExpReplace(StringRegExpReplace($IP, ";.*", ""), ".*@", "") $Ex_Password = StringRegExpReplace($IP, ".*;", "") $O_RDPFile = "full ip address: " & $Ex_IPAddressPort & @CRLF & "username: " & $Ex_DomainUsername & @CRLF & "password: " & $Ex_Password & @CRLF & @CRLF ConsoleWrite($O_RDPFile) Next I want to extract texts, convert them and then show in console or write in file like this: full ip address: 127.0.0.1:3389 username: Administrator password: 12345 full ip address: 120.0.0.1:3389 username: Guest password: 54321 [SOLVED] I've putted on right code here, you can use this little code if you need Edited April 23, 2019 by Colduction Link to comment Share on other sites More sharing options...
mikell Posted April 23, 2019 Share Posted April 23, 2019 1 hour ago, Colduction said: here is my code Apparently SRER don't scare you so you might use this one too $txt = "127.0.0.1:3389@Administrator;12345" & @CRLF & "120.0.0.1:3389@Guest;54321" Msgbox(0,"", StringRegExpReplace($txt, '(?m)^(.*?)@(.*?);(.*)', _ "full ip address: $1" & @crlf & "username: $2" & @crlf & "password: $3" & @crlf) ) RestrictedUser 1 Link to comment Share on other sites More sharing options...
RestrictedUser Posted April 23, 2019 Author Share Posted April 23, 2019 @mikell, thanks for your Regular Expression, i think you've decreased cpu usage with your approach 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