本帖最后由 qixiaobin0715 于 2022-11-21 09:28 编辑
实际上也不算另类,bat文件和1.txt文件均另存为ANSI编码:- @echo off
- (for /f "delims=" %%a in (1.txt) do (
- echo,%%a
- set /a n+=1
- if "%%a"=="====" goto :a
- ))>2.txt
- :a
- setlocal enabledelayedexpansion
- (for /f "skip=%n% delims=" %%i in ('type 1.txt^|sort') do (
- if not "!str!"=="%%i" echo,%%i
- set str=%%i
- ))>>2.txt
- pause
复制代码
|