字典整理腳本

***測試時,好的字典是少不了的
但平時臨時添加的字典卻是很亂D
需要在原基礎上擴展時,就需要整理了
腳本功能:
1.支持拖放!
2.去除重複
3.排序
On Error Resume Next
'Code By NetPatch
Set Arg=Wscript.Arguments
If Arg.Count=0 Then Wscript.Quit
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Conn = CreateObject("ADODB.Connection")
Set Rs = CreateObject("ADODB.Recordset")
path=left(Arg(0),InstrRev(Arg(0),"\"))
Fname=replace(Arg(0),path,"")
Set MyTables = fso.CreateTextFile(arg(0)&".txt",true)
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&path&";Extended
Properties=""text;HDR=NO;FMT=Delimited"""
Rs.Open "Select DISTINCT * FROM " & Fname,_
Conn, 3, 3, &H0001
Do Until Rs.EOF 'N/P
MyTables.WriteLine Rs.Fields.Item(0).Value   
Rs.MoveNext
Loop
MyTables.Close
Set MyTables = Nothing
Rs.Close
Conn.Close
Set fso = Nothing
Set Rs = Nothing
Set Conn = Nothing
Wscript.echo "整理完畢!"
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章