Created
February 6, 2024 14:26
-
-
Save brovish/72860d69000a6e58d0d27522b5bce968 to your computer and use it in GitHub Desktop.
search word in files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal EnableDelayedExpansion | |
| set "FOLDER_PATH=D:\Software\FAF\Logs\lex" | |
| set "TEMP_FILE=%TEMP%\temp_results.txt" | |
| if exist "%TEMP_FILE%" del "%TEMP_FILE%" | |
| for /R "%FOLDER_PATH%" %%f in (*_2_6_2024.log) do ( | |
| set /a count=0 | |
| for /f "tokens=3" %%i in ('find /c /i "pid" "%%f"') do ( | |
| set /a count=%%i | |
| ) | |
| echo !count!, %%f>> "%TEMP_FILE%" | |
| ) | |
| sort "%TEMP_FILE%" | |
| del "%TEMP_FILE%" | |
| endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment