|
|
发表于 2016-6-6 14:37:22
|
显示全部楼层
@echo off
setlocal enabledelayedexpansion
set A=a.txt
set B=b.txt
call :shu %A%
set Ans=%ns%
call :shu %B%
set Bns=%ns%
if %Ans% gtr %Bns% (set ends=%Ans%) else (set ends=%Bns%)
call :One %A%
call :endf %A%
>c.txt (echo,%Onef%)
for /l %%a in (1,1,%ends%) do (
call :wording %%a %A%
call :wording %%a %B%
)
>>c.txt echo;%endf%
echo,已完成
pause
exit
:shu
for /f "delims=: tokens=1,*" %%a in ('findstr /n ".*" %1') do (set ns=%%a)
goto :eof
:wording
for /f "delims=*" %%b in ('findstr /c:"%1," %2') do (echo,%%b)>>c.txt
goto :eof
:One
for /f %%a in ('type %1') do (
set Onef=%%a
goto :eof
)
goto :eof
:endf
for /f "usebackq" %%a in (`type %1`) do (set endf=%%a)
goto :eof |
|