联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
CODE: [Copy to clipboard]@echo off REM 却掉重复的行,按原顺序只留唯一 REM 用于挑出唯一命令、用于在让搜索到的电子邮件地址的唯一不重复性 REM 如果是含有批处理禁忌的特殊符号就算了,它就适合于上面功能。 REM ============== S.bat ====================== REM 请将需要唯一不重复行的数据存成 dat.txt 文件名即可 REM 以防止万一,自己建立的目录你自己删吧~:) md redtek for /f "tokens=*" %%a in (dat.txt) do ( md redtek\^"%%a^" ) dir /b /od redtek\ > Ok.txt Notepad.exe Ok.txt
CODE: [Copy to clipboard]dos china bat redtek@sweetmeet.com dos china bat Redtek@sweetmeet.com dos china bat com mco comm comm on redtek@sweetmeet.com on commm com on mmn comm ono bta bat b 2006 2006 12 2006.12.2006 [code]
CODE: [Copy to clipboard]starttime=timer on error resume next set fso=createobject("scripting.filesystemobject") set fd=fso.getfile(Wscript.Arguments(0)) set file=fso.opentextfile(Wscript.Arguments(0),1) Do while not(file.AtEndOfStream) n = n + 1 tmp = file.readline ReDim Preserve temp(n-1) temp(n-1)= tmp loop file.Close For x=0 to n-1 For y= 1 to n-1 If x <> y Then If temp(x) =temp (y) And x < y Then temp(y)="{059F6FBC-10FB-4FBC-BCF7-DB362A3DB1DB}" End If End If Next Next For x=0 to n-1 if temp(x)<>"{059F6FBC-10FB-4FBC-BCF7-DB362A3DB1DB}" then S= S & temp(x) & vbcrlf Next Set file = fso.OpenTextFile(Wscript.Arguments(0), 2, True) file.write S file.Close endtime=timer yongshi=cdbl(endtime-starttime) msgbox "已经将" & fd.name & "文件里相同行的内容删除,用时" & Round(yongshi,2) & "妙。" & vbcrlf & "(保留了相同行内容的最上面的一行!)" ,48+4096,"操作完成" set fso=nothing set fd=nothing set file=nothing