Lev

|
Posted: Mon Jul 28, 2008 22:10 Post subject: |
|
|
то же самое на vbs
Code: | 'noduplines.vbs
'удаление дублирующихся строк из выделенного в тотале файла и сохранение в *.filtered
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Dict = CreateObject("Scripting.Dictionary")
Set TCS = CreateObject("TCScript.Helper")
ff=TCS.GetSrcSelectedFiles(-1)(0)
Set TextFile = FSO.OpenTextFile(ff, 1)
Do While TextFile.AtEndOfStream <> True
strLine = textFile.ReadLine
If not Dict.Exists(strLine) Then Dict.Add strLine, 1
Loop
For Each m In dict.Keys
s = s & m & vbCrLf
Next
Set f = FSO.CreateTextFile(ff & ".filtered")
f.Write s
f.Close |
|
|