不清楚你的实际文件/情况,仅以问题中的样例/说明为据
复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的文件放一起运行
@璐村惂鐢ㄦ埛_000076K馃惥 off
rem 删除多个文本文件里指定行中的指定字符串内容
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%
@璐村惂鐢ㄦ埛_053Q95e馃惥 %z%
cd /d "%~dp0"
set "newfolder=%~dp0#result"
if not exist "%newfolder%" (md "%newfolder%")
powershell -NoProfile -ExecutionPolicy bypass ^
$n=3;$enc=[Text.Encoding]::Default;^
$files=@(dir -liter '%~dp0'^|?{('.bat' -ne $_.Extension) -and ($_ -is [System.IO.FileInfo])});^
for($i=0;$i -lt $files.length;$i++){^
write-host ('['+($i+1)+']'+$files[$i].Name);^
$text=[IO.File]::ReadAllLines($files[$i].FullName, $enc);^
if($n -lt $text.count){$text[$n-1]=$text[$n-1].replace('X0 Y0 Z0','');};^
[IO.File]::WriteAllLines('%newfolder%\'+$files[$i].Name, $text, $enc);^
};
:end
echo;%#% +%$%%$%/%@% %z%
pause
exit