Board logo

标题: 排序,过滤相同行(简单批处理) [打印本页]

作者: bagpipe     时间: 2006-8-11 09:08    标题: 排序,过滤相同行(简单批处理)
@echo off
setlocal
if (%1)==() goto end
sort<%1 >tmp.txt
set "a="&(set b=)
type nul>sss.txt
for /f "delims=" %%a in (tmp.txt) do call :hehe "%%a"

del tmp.txt
set "a="&(set b=)
goto :eof

:hehe
set a=%b%
set b=%~1
if not "%a%"=="%b%" echo %b% >>sss.txt
goto :eof


:end
echo 对不起,参数错误!!!


此批处理现只对.TXT文本文件有用,主要是排序和过滤相同行

实在没的可发了,主要是学习而用,有些符号没有做相应过滤