私の入力ファイル Count.txt には、次のものが含まれています。
] /Count 1
] /Count 2
各行の最後に数字を追加して、別のファイルに保存するか、別の変数に保存しようとしています。次のバッチ ファイル スクリプトでは実行できません。
setlocal enabledelayedexpansion
set count=0
for /f "tokens=3 delims= " %%i in ('findstr Count Count.txt') do (
set /a count=%%i + %count%
echo !count! > finalcount.txt
)
endlocal
私が得ている出力は2です。
助けてください。