in my sample code i managed to get only the entire line,
any help would be appreciated.
p.s - the sample txt file in the code is dynamist, more lines of users can appear.
Code: Select all
FileDelete, c:\temp\querytest.txt
FileAppend,
(
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
12345678 1 Disc 1:14 19/01/2021 16:38
test_user rdp-tcp#13 2 Active . 14/01/2021 19:43
),c:\temp\querytest.txt
FileRead, OutputVar, c:\temp\querytest.txt
Loop, Parse, OutputVar, `n,`r
{
FileLine = %A_LoopField%
Lookfor := "test_user" ; im looking for the SESSIONNAME of "test_user" which should be "rdp-tcp#13"
IfInString, FileLine, %Lookfor%
{
MsgBox % A_LoopField
}
}