|
下面代码是别人写的,是针对a.txt批处理,我想针对a.txt批处理后,把结果导出在b.txt ,请大家帮忙,谢谢!!
@echo off&setlocal enabledelayedexpansion
for /f "skip=1 delims=" %%a in (a.txt) do (
set /a n+=1
if not defined str (
for /f "tokens=1,2,4 delims=- " %%b in ("%%a") do set "str=%date:~,4%年%%b月%%c日 %%d"
) else (
for /f "tokens=3,4 delims=: " %%b in ("%%a") do (
set "_%%b%%c_!n!=!str! %%b:%%c"&set "str="
set /a m+=1%%b %% 100,s+=1%%c %% 100
if !s! gtr 60 set /a s-=60,m+=1
if !m! gtr 60 set /a m-=60,h+=1
)
)
)
for /f "tokens=2 delims==" %%a in ('set _^|sort /r') do echo,%%a
for %%a in (h m s) do set "%%a=00!%%a!"&set "%%a=!%%a:~-2!"
echo,合计:%h%:%m%:%s%
pause>nul |
|