Relevance for identifying a unique keyword from a .txt file and generate a output in a numeric value against the search

Need help on creating a relevance to identify a unique keyword from a .txt file and generate a numeric value against the search result…

e.g. As we have given data under .txt file…

0001,Win32NT,Administrator,Successful,9/09/2016 3:13:08 PM
0002,Win32NT,Administrator,Successful,9/11/2016 3:13:08 PM
0003,Win32NT,Administrator,fail,9/11/2016 3:13:08

Now in this file, I need to search a keyword “Successful” and based on the search the output should reflect as a numeric value i.e. 2 (successful), 1 (Fail)

you can give a try it -

if exists file “c:\users\abc\desktop\hi.txt” whose (exists lines whose (it contains “hi”)of it ) then 2 else 1

Hi @vk.khurava , the requirement is to count the total number of line and total number of successful (keyword) count and generate the same in numeric value…

for e.g.

0001,Win32NT,Administrator,Successful,9/09/2016 3:13:08 PM
0002,Win32NT,Administrator,Successful,9/11/2016 3:13:08 PM
0003,Win32NT,Administrator,fail,9/11/2016 3:13:08

Total No. of Lines = 3, Successful Count =2, Fail Count =1

Q: (number of lines of it, number of lines whose (it contains "Successful") of it, number of lines whose (it contains "fail") of it ) of file "c:\temp\log.txt"
A: 3, 2, 1
1 Like

Thanks @gearoid, sir, for your prompt support…