@ahk7
Thanks for the explanation!
Search found 336 matches
- 24 Jan 2021, 08:00
- Forum: Ask For Help
- Topic: Help with library: TF.ahk
- Replies: 12
- Views: 458
- 21 Jan 2021, 11:45
- Forum: Ask For Help
- Topic: Help with library: TF.ahk
- Replies: 12
- Views: 458
Re: Help with library: TF.ahk
If this is the actual file format DisplayName,Username,Office,SNIFSITECODE,ComputerName,IPAddress,Date,Time,OSVersion,SESSIONNAME,SentCount Mike,Mike1,London,None,TESTPC,10.254.50.6,21\01\2021,16:38:16,WIN_7,console,1 Mike,Mike1,London,None,TESTPC,10.254.50.6,21\01\2021,16:38:16,WIN_7,console,2 and...
- 21 Jan 2021, 09:48
- Forum: Ask For Help
- Topic: Help with library: TF.ahk
- Replies: 12
- Views: 458
Re: Help with library: TF.ahk
find = 10.254.50.6 count := StrSplit(TF_Find(text,,, "^" StrReplace(find, ".", "\.") "$", 0, 0), ",").Count() MsgBox, 64, Results for %find%, %count% Nice! 2 things to resolve please: 1. when there nothing was found - the result is still "1" which should be "0" 2. i changed the file format and i wa...
- 21 Jan 2021, 07:48
- Forum: Ask For Help
- Topic: Help with library: TF.ahk
- Replies: 12
- Views: 458
Re: Help with library: TF.ahk
I thought that you wanted a boolean result. Below is a line count. find = 10.254.50.6 MsgBox, 64, Count for %find%, % lineCount(text, find) lineCount(str, find) { StrReplace("`n" str "`r", "`n" find "`r",, count) Return count } works very well, thanks! i will still not accept this answer in forum o...
- 21 Jan 2021, 07:17
- Forum: Ask For Help
- Topic: Help with library: TF.ahk
- Replies: 12
- Views: 458
Re: Help with library: TF.ahk
Possibly something like: WordCount := TF_Count(TF("Test_TestFile.txt", "WordCount") "\D" ,"10.254.50.6") > 0 Also: find = 10.254.50.6 found := Instr("`n" text, "`n" find) > 0 MsgBox, 64, Result for %find%, % found ? "True" : "False" Nice try @mikeyww but its still fail to count correctly, try with ...
- 21 Jan 2021, 06:56
- Forum: Ask For Help
- Topic: Help with library: TF.ahk
- Replies: 12
- Views: 458
Help with library: TF.ahk
tf.ahk How to use \D toggle for EXACT match so the correct result will be 1 and not 3 ? Thanks in advance! #Include tf.ahk text= (join`r`n 1 2 3 4 10.2.10.2 10.254.50.60 10.254.50.61 10.254.50.6 10.10.10.10 10.2.1.100 ) FileDelete, Test_TestFile.txt FileAppend, % text, Test_TestFile.txt WordCount:=...
- 20 Jan 2021, 08:58
- Forum: Ask For Help
- Topic: Help with reading a file Topic is solved
- Replies: 10
- Views: 213
Re: Help with reading a file Topic is solved
Thanks @garry but there not could be more than 1 same active user i need to get in a msgbox only the SESSIONNAME of the active user without any other text without any spaces or tabs. see my sample txt file in last post (editted) thanks! edit: may this will do the job: f1=%a_scriptdir%\querytest.txt ...
- 20 Jan 2021, 08:37
- Forum: Ask For Help
- Topic: Help with reading a file Topic is solved
- Replies: 10
- Views: 213
Re: Help with reading a file Topic is solved
@garry can you replace it by the STATE "Active" instead of the USERNAME "test_user" to get the current SESSIONNAME ? Sample of txt file to read f1=%a_scriptdir%\querytest.txt ifexist,%f1% FileDelete,%f1% FileAppend, ( USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME 12345678 1 Disc 21:10 19/01/202...
- 20 Jan 2021, 07:57
- Forum: Ask For Help
- Topic: Help with reading a file Topic is solved
- Replies: 10
- Views: 213
Re: Help with reading a file Topic is solved
Thank you both!
- 19 Jan 2021, 13:31
- Forum: Ask For Help
- Topic: Help with reading a file Topic is solved
- Replies: 10
- Views: 213
Help with reading a file Topic is solved
i want to get in a msgbox only the SESSIONNAME of the user "test_user", 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. FileDelete, c:\temp\querytest.txt FileAppend, ( USERNAME ...
- 18 Jan 2021, 09:42
- Forum: Scripts and Functions
- Topic: [library] TF: Text files & Variables (strings) v3.8
- Replies: 53
- Views: 24574
Re: [library] TF: Text files & Variables (strings) v3.8
Well, there is https://github.com/hi5/TF#TF_Count but as you will have seen it doesn't support files only variables (strings). But we can make use of TF() https://github.com/hi5/TF#TF to read the contents of a file into a variable and use that - see also section underneath "Introduced in v3: TF()" ...
- 14 Jan 2021, 13:26
- Forum: Scripts and Functions
- Topic: [library] TF: Text files & Variables (strings) v3.8
- Replies: 53
- Views: 24574
Re: [library] TF: Text files & Variables (strings) v3.8
hello,
i have a txt file with some same words,
i want to count only these words to a number
file contanis:
1
2
3
4
4
4
5
6
7
i want to count how many "4" i have in the file,
result should be 3
i have a txt file with some same words,
i want to count only these words to a number
file contanis:
1
2
3
4
4
4
5
6
7
i want to count how many "4" i have in the file,
result should be 3
- 26 Oct 2020, 10:46
- Forum: Ask For Help
- Topic: Help with reading csv file Topic is solved
- Replies: 12
- Views: 264
Re: Help with reading csv file Topic is solved
my final code thanks to @Xtra & @mikeyww #NoEnv SetBatchLines, -1 FileDelete, c:\csvfile.csv FileDelete, c:\new_csvfile.csv ; sample of csv file FileAppend, ( From: dsadasdas <dsadasd>,,,,,,,,,,,,, "Sent: Sunday, April 07, 2019 10:22 AM",,,,,,,,,,,,, To: dasdsadsada <adsadasdas>; Tsdadi <dasdasda>...
- 26 Oct 2020, 10:27
- Forum: Ask For Help
- Topic: Help with reading csv file Topic is solved
- Replies: 12
- Views: 264
Re: Help with reading csv file Topic is solved
it works tnx !mikeyww wrote: ↑25 Oct 2020, 16:42You can replace the Instr line with whatever condition identifies your lines of interest. It might be like the following.
You can decide based on whatever sort of text you are handling.Code: Select all
If RegExMatch(Line, "^\d+?,")

- 25 Oct 2020, 16:13
- Forum: Ask For Help
- Topic: Help with reading csv file Topic is solved
- Replies: 12
- Views: 264
- 25 Oct 2020, 16:03
- Forum: Ask For Help
- Topic: Help with reading csv file Topic is solved
- Replies: 12
- Views: 264
Re: Help with reading csv file Topic is solved
Thanks Xtra its perfect ! Edit: its still not handle this for example: ; sample of csv file FileAppend, ( From: dsadasdas <dsadasd>,,,,,,,,,,,,, "Sent: Sunday, April 07, 2019 10:22 AM",,,,,,,,,,,,, To: dasdsadsada <adsadasdas>; Tsdadi <dasdasda>,,,,,,,,,,,,, Subject: dasdasdas,,,,,,,,,,,,, ,,,,,,,...
- 25 Oct 2020, 15:51
- Forum: Ask For Help
- Topic: Help with reading csv file Topic is solved
- Replies: 12
- Views: 264
Re: Help with reading csv file Topic is solved
Thanks Xtra !
but i get:
"This line does not contain a recognized action."
but i get:
"This line does not contain a recognized action."

- 25 Oct 2020, 15:49
- Forum: Ask For Help
- Topic: Help with reading csv file Topic is solved
- Replies: 12
- Views: 264
Re: Help with reading csv file Topic is solved
Thanks mikeyww! its works fine! problem is the the original csv i work with sometimes have more text outside the "table" at the beginning and end of the csv, so the files csv looks like this: FileAppend, ( text1 text2 text3 text4 text5 ID,SN,Type,Model,Model Company,Address,Adress2,Room,Username,IT ...
- 25 Oct 2020, 14:47
- Forum: Ask For Help
- Topic: Help with reading csv file Topic is solved
- Replies: 12
- Views: 264
Help with reading csv file Topic is solved
i need help with getting only the values of the columns "ID" and "CompanyID" in each row to a new csv file. so according to my sample code the outcome of the new csv file should be: 1. 210269, SC12345678910 2, 210271, 456123 notes: * the row numbers not constant * csv file may have more than 2 rows ...
- 22 Oct 2020, 12:54
- Forum: Ask For Help
- Topic: Help with FileEncoding Topic is solved
- Replies: 6
- Views: 179
Re: Help with FileEncoding Topic is solved
Edit:
Thanks !
works like a charm!
using 65001 ( Unicode (UTF-8) )
Thanks !
works like a charm!

using 65001 ( Unicode (UTF-8) )