回复 28# inflikt
终于知道是什么问题了,b.txt 2009的下面一行才一个数字...重新修改了一下,应该可以了.- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('dir /a-d /b /s *.txt') do (
- set "n="
- for /f "usebackq tokens=1,* delims= " %%i in ("%%a") do (
- if defined flag (
- for %%A in (!str!) do (set/a n+=1,s=n-1 & set str_!n!=%%A)
- if /i "%%i"=="avge" (set "flag=" & call echo "%%~nxa" --- %%str_!s!%%)
- )
- set str=%%i %%j
- if /i "!str: =!"=="D11Finalseasonallyadjusteddata" set flag=1
- )
- )
- pause
复制代码
|