本帖最后由 terse 于 2023-1-23 22:54 编辑
这样呢- @echo off&setlocal enableDelayedExpansion
- (for /f "delims=" %%i in (a.txt) do (
- if not defined _"%%i" (
- echo,%%i
- set _"%%i"=%%i
- ) else if not "!_"%%i"!" == "%%i" echo %%i
- ))>b.txt
复制代码 没测试- @echo off&setlocal enableDelayedExpansion
- (for /f "delims=" %%i in (a.txt) do (
- if not "!_"%%i"!" == "%%i" echo %%i
- set _"%%i"=%%i
- ))>b.txt
复制代码
|