本帖最后由 qixiaobin0715 于 2022-10-29 09:35 编辑
回复 1# wocool
如果行数不是太多,试试下面代码,bat文件另存为ANSI编码:- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=1* delims=?" %%i in (2.txt) do set "_%%i=%%i?%%j"
- (for /f "tokens=1* delims=|" %%i in (1.txt) do (
- if defined _%%i (
- echo,!_%%i!^|%%j
- ) else (
- echo,%%i^|%%j
- )
- ))>new.txt
- pause
复制代码
|