我需要计算文件(%LOGDIR%%NORMALMEMORY%
)中的行数。
for / f循环对行进行计数,但是我不知道为什么它没有正确存储在%MAPCOUNT%
变量中。
日志文件提供了此信息:
set /a MAPCOUNT=3 Commande ECHO activ�e. Used map count is Number of available maps is Map state changed to NORMAL
FOR /f %%a in (%LOGDIR%%MAPMEMORY%) do (
if "%%a" == "NORMAL" (
echo MAP state is NORMAL
for /f %%b in ('find /v /c "" ^< %LOGDIR%%NORMALMEMORY%') do set /a MAPCOUNT=%%b
echo %MAPCOUNT%
echo Used map count is %MAPCOUNT%
echo Number of available maps is %DIRCOUNT%
echo Map state changed to PENURIE
echo PENURIE > %LOGDIR%%MAPMEMORY%
)
我希望将行数存储在%MAPCOUNT%变量中。