- 帖子
- 68
- 积分
- 88
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2016-5-17
|
回复 7# terse
结果与上一个一样,输出如下;
AAAAA 1
BBBBB 2
GGGG
衷心感谢
使用code;
@echo off
setlocal enabledelayedexpansion
for /f "tokens=1*" %%i in ('findstr /ig:b.txt a.txt') do if "#%%j" == "#" (set #%%i=new) else set #%%i=%%j
>ABresult.txt (for /f %%i in ('type b.txt') do for /f "tokens=*" %%i in ("%%i !#%%i!") do echo;%%~nxi)
pause |
|