boshi Posted February 18, 2011 Share Posted February 18, 2011 Hello all autoit programmers, I have been using this code to read a text file line by line $File = FileOpen("email.txt", 0) ; open email.txt that contain email list line by line If $File = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While 1 $Line = FileReadLine($File) If @error = -1 Then ExitLoop $EmailPass = StringRegExp($Line, "(.+@.+\..+)", 1) If @error = 0 Then WEnd So now i want to put the email with password using format like : stevenson77@hotmail.com:123pass so i need to modify $EmailPass to separate between mail and pass using StringSplit or StringRegExp? $email = StringSplit($EmailPass[0], ":") is this ok? what the email and password variable would be? or anyone can make it look nice $email[1] for the email ? $email[2] for the password ? Link to comment Share on other sites More sharing options...
Varian Posted February 18, 2011 Share Posted February 18, 2011 Give a sample of the text that's in the text file. Link to comment Share on other sites More sharing options...
hannes08 Posted February 18, 2011 Share Posted February 18, 2011 Hi boshi, let's just assume your list looks like this: e@mail.com:pw1234 f@mail.com:pw1235 g@mail.com:pw1236 then a StringSplit($line, ":") would result in an array: [0] => 2 [1] => e@mail.com [2] => pw1234 or for the second line: [0] => 2 [1] => f@mail.com [2] => pw1235 Regards, Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] 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