不清楚你的实际文件,仅以问题中的样例为据
@echo off
set @=有问题联系&set #=Q&set/az=0x53b7e0b4
title %@% +%#%%#% %z%
set "rootpath=%~dp0"
cd /d "%rootpath%"
set "输入=a.txt"
set "输出=b.txt"
(for /f "tokens=1* delims=:" %%a in ('type "%输入%"^|findstr /n .*') do (
if %%a leq 3 (
echo;%%b
) else (
for /f "tokens=1-3 delims=/" %%c in ("%%b") do (
set "line=%%c/%%d"&set /a x=8-%%e
setlocal enabledelayedexpansion
echo;!line!/!x!
endlocal
)
)
))>t.t
move /y t.t "%输出%"
echo;%@% +%#%%#% %z%
pause