How to read 2 contents from 1 line of txt?

Get help with using AutoHotkey and its commands and hotkeys
dw0rd1337
Posts: 3
Joined: 13 Sep 2020, 15:13

How to read 2 contents from 1 line of txt?

13 Sep 2020, 15:29

Hello, can u help me?
Im need read two contents from one line:

example.txt:
username:password

Im need:

FileRead, example.txt
get %username% and %password% from txt

MsgBox, Ur Username - %username% Password - %password%
User avatar
elModo7
Posts: 189
Joined: 01 Sep 2017, 02:38
GitHub: elModo7
Location: Spain
Contact:

Re: How to read 2 contents from 1 line of txt?

13 Sep 2020, 15:41

You can split it in this case:

Code: Select all

txt = john:notMyRealPassword
data := StrSplit(txt, ":")
MsgBox, % "Username: " data[1] "`nPassword: " data[2]
:beer:

Return to “Ask For Help”

Who is online

Users browsing this forum: Eik, kingamir022, mikeyww, teadrinker and 24 guests