I'd like to compute the average number of lines of specific files from CMD. To find the number of lines of one file I've got:
findstr /R /N "^" "FILENAME" | find /C ":"
So I'd have something like this:
setlocal enabledelayedexpansion set sum = 0 for /l %%x in (1, 1, 10) do ( set tmpnum = findstr /R /N "^" "file-%%x.csv" | find /C ":" set /a sum=sum+tmpnum ) echo %sum%/10 endlocal
The problem is that sum
is always 0 and I believe tmpnum
does not get the correct value assigned.