Batch to search through txt files

MasterOfNothing

Commendable
Aug 19, 2016
4
0
1,510
Hi forum users :),

is it possible, to make a batch to search through all .txt files, that are in the same folder?

Basically, I want to adjust the following .bat, so that instead of having to manually enter the .txt name, it will automatically find any .txt and then does it's search.

Any ideas?

Kind regards, MasterOfNothing, SlaveToEverything

This is the current .bat, where it requires manual input:
@echo off
:loop
echo Looted so far:
@echo off
find /n /c "Name:" C:\Users\sig\Desktop\Dream\Dream\Logs\2016-08-16-14.txt
timeout /t 10
@echo off
echo Captured so far:
find /n /c "CatchSuccess" C:\Users\sig\Desktop\Dream\Dream\Logs\2016-08-16-14.txt
@echo off
echo Counter restart after time expires
timeout /t 60
goto loop
 

MasterOfNothing

Commendable
Aug 19, 2016
4
0
1,510
Cheers, that actually does work.

Except for an unexpected problem. Every .txt has it's one counter.
The result is:
Looted so far:
---------- 2016-08-19-20.TXT: 1

---------- 2016-08-19-21.TXT: 104

---------- 2016-08-19-22.TXT: 126

---------- 2016-08-19-23.TXT: 18
Any way to combine those numbers, 1,104,126,18, so I can run a check, whether the total exceeds a threshold?
 
Hello... Explain to me your "Math" or what your trying to count?... or Total you want to read? My experience is with Counter logic is in PLC's, not DOS batch files... Typically you write a "Boolean" statement/symbol for the Math... and you would need to define the Type of number you are using (FP,integer,?), and have a result put into a memory location, and then calling that memory Location back into your statement, for more math/read statements.
 

MasterOfNothing

Commendable
Aug 19, 2016
4
0
1,510
Every .txt gets searched and will output a number, the goal is to add those numbers, to get one final number and then check, whether that's higher than 1000.
So in this case:
1+104+126+18=x
x > 1000 ?

Edit:
The actual goal is to search through every single. txt file in a folder for the word "success" and output how often the word "success" has been written in total.