@echo off
setlocal enabledelayedexpansion
cd.>b.txt
for /f "delims=" %%i in ('more a.txt^|findstr /i /c:"aaa"') do (
set "str=%%i"
set str=!str:aaa=!
echo !str!>>b.txt
)
@echo off
setlocal enabledelayedexpansion
for /f "tokens=* skip=2" %%i in ('find "AAA" "c:\a.txt"') do (
set var=%%i
echo !var:AAA=!>>temp.txt
)
sort
1063971928qq提供的答案不成功。