如何用批处理提取出a.txt文档中的指定字符到b.txt a.txt文件内容 File Copy: C:尀WINDOWS尀system32尀upgrad

2024-11-25 06:18:55
推荐回答(2个)
回答1:

@echo off&setlocal enabledelayedexpansion
for /f "tokens=1,4 delims=|" %%a in (a.txt) do (
set "str=%%a"
set "verstr=%%b"
set str=!str:*:=!
echo !str! !verstr!>>b.txt
)
start b.txt

回答2:

for /f "tokens=3,6 delims=| " %i in (a.txt) do @echo %i %j >>b.txt