@Echo off & SetLocal EnableDelayedExpansion
set dstfile=历史纪录.txt
set srcfile=20080311.txt
for /f "tokens=2 delims==元" %%i in (%srcfile%) do set count=%%i
for /f "delims=" %%a in (%dstfile%) do (
set string=%%a
if "!string:~0,4!"=="便民商店" (
>>_temp.txt echo.便民商店 s=%count%元
) else (
>>_temp.txt echo.!string!
)
)
type _temp.txt > %dstfile%
del _temp.txt & start %dstfile%