本帖最后由 xxpinqz 于 2013-5-5 03:03 编辑
- @echo off&setlocal enabledelayedexpansion
- set "str1=我想"&set "str2=要的效果"
- for %%a in (*.txt) do (
- set /a q=2,l=0,n=0
- for /f "tokens=2 delims=:" %%b in ('find /v /c "" "%%a"') do set /a h=%%b-1
- (for /f "delims=" %%c in ('type "%%a"') do (
- set /a l+=1
- set /a x="1/(!q!-!l!)",y="1/(!h!-!l!)" 2>nul&&(
- echo %%c
- )||(
- set com="(echo %%c^&echo,)|findstr /o "$""&set "str=%%c"
- for /f "delims=:" %%d in ('!com!') do set /a id="(%%d-2)/2"
- set /a n+=1
- for /f "tokens=1-2 delims= " %%e in ("!n! !id!") do echo !str:~,%%f!!str%%e!!str:~%%f!
- )
- ))>"%%~na.$$$"
- )
- ::ren *.$$$ *.txt
复制代码 原来这个变量x,y可以不要的啊,不知道 |