沸羊羊 当前离线
列兵
回复 沸羊羊 没找到本来就不执行写入tmpfile,一行一行的替换需要考虑有两列及其以上的字段相同时,会 ... xxpinqz 发表于 2016-8-24 13:18
TOP
GNU 当前离线
上尉
@echo off setlocal enabledelayedexpansion (for /f "delims=" %%a in ('type "b.txt"') do ( set LineB=%%a set /p LineA= for /f "tokens=1-2 delims=," %%x in ("!LineA!") do ( set LineNew=!LineB:%%x=%%y! ) echo !LineNew! ))<"a.txt" > "c.txt"复制代码
happy886rr 当前离线
等待验证会员
for /f "tokens=1-3 delims=:," %%a in ('findstr /n .* a.txt') do (sed -i "%%as/,%%b,/,%%c,/" b.txt)复制代码