CLS
TITLE Daniel Application Menu
echo.
echo ***************************************
echo * *
echo * Daniel Application Menu *
echo * *
echo ***************************************
echo.
echo 1 - Datamart and File Status Checking
echo 2 - Log Error Checking
echo.
echo.
::command to call different bat
set /p "cmd=Enter the command [Q > Exit]:"
IF %cmd% EQU 1 (
call "F:\project_DOS command\batch - Status checking.bat"
) ELSE (
IF %cmd% EQU 2 (
call "F:\project_DOS command\batch - Log error checking.bat"
) ELSE (
IF %cmd% EQU Q (
Exit
) ELSE (
echo Wrong Command
)))
pause
________________________________________________________________
@echo off
CLS
Title Error checking
call:checkerror "F:\project_DOS command\error(201509).log" test
::report layout
echo.
echo ***********************************
echo * *
echo * Error Checking *
echo * *
echo ***********************************
echo.
echo file name Error count
echo _____________________________________________
echo error(201509).txt %error_cnt_test%
echo.
echo.
::report layout
::command to call different bat
set /p "cmd=Enter the (0 to menu ; Q to Quit):
IF %cmd% EQU 0 (
call "F:\project_DOS command\Menu.bat"
) ELSE (
IF %cmd% EQU Q (
Exit
) ELSE (
call "F:\project_DOS command\batch - Log error checking.bat"
))
pause
::Funciton Declare
:checkerror
set "file=%~1"
set /a cnt=0
for /f %%a in ('type "%file%"^|find /I /c "error"') do set /a error_cnt_%2=%%a