返回列表 发帖
不知行否,会在原本文件名前面添加new_创建新文件
@echo off
set "z=绗.*绔"
chcp 65001
for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
setlocal
(for /f "delims=" %%k in ('findstr /n .* "%%i"') do (
set "str=%%k"
setlocal enabledelayedexpansion
echo=!str:*:=!|findstr /i /b  "!z!" 1>nul && set aaa=1
if defined aaa (
echo=&echo=&echo=
echo=!str:*:=!
echo=&echo=&echo=
set aaa=
) else (
echo=!str:*:=!
)
endlocal
))>"new_%%i.txt"
endlocal
)
chcp 936&echo done&pause&exit /bCOPY

TOP

返回列表