|Hi guys, i currently have a batch script that counts the number of lines in a file and a batch script that reads the file name and outputs the file name. Can anyone provide me with the solution on how to multiply the number of lines in X text file with X file name. |
Here is my script.
for /f "tokens=*" %%t in ('dir/b sg*') do (
if !lines! gtr 0 echo !lines!set lines=
for /f "tokens=* skip=1" %%a in (%%t) do (
set /a N+=1
set /a lines+=1
if !lines! gtr 0 echo !lines!>>lineX.txt&&set lines=
set fileout=!filein:~2,2! !filein:~4,2! !filein:~6,3!
echo total is !N!>>lineX.txt
Thanks in advance,