1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f , f1, f2
Dim st ,st1
Set objDictionary = CreateObject("Scripting.Dictionary")
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\Fic1.txt", ForReading)
Set f1 = fso.OpenTextFile("C:\Fic2.txt", ForReading)
Set f2 = fso.CreateTextFile("C:\FicResult.txt")
Do Until f.AtEndOfStream
ligne = f.ReadLine
If Not objDictionary.Exists(ligne) Then
objDictionary.Add ligne, ligne
End If
Loop
f.Close
f1.Close
f2.Close
Set f2 = fso.OpenTextFile("C:\FicResult.txt", ForWriting)
For Each strKey in objDictionary.Keys
f2.WriteLine strKey
Next
f2.Close |
Partager