Téléchargé 6 fois
Vote des utilisateurs
1
0
Détails
Licence : Non renseignée
Mise en ligne le 29 décembre 2011
Plate-forme :
Windows
Langue : Français
Référencé dans
Navigation
Supprimer les lignes en double dans un fichier texte
Supprimer les lignes en double dans un fichier texte
Supprimer les lignes en double dans un fichier texte
Salut...
Rien à redire, parfait. avec une petite modif en VB en supprimant les "Set"

Merci
Rien à redire, parfait. avec une petite modif en VB en supprimant les "Set"
| Code : | Sélectionner tout |
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 34 35 36 | Option Explicit On
Const ForReading = 1
Const ForWriting = 2
Sub SupprimetTexteEndouble()
Dim oDict As Scripting.Dictionary
Dim oFSO As Scripting.FileSystemObject
Dim oFile As Scripting.TextStream
Dim maCle As String
Dim strName As String, Fichier As String
Fichier = "C:\Test_Doublon.txt"
oDict = CreateObject("Scripting.Dictionary")
oFSO = CreateObject("Scripting.FileSystemObject")
oFile = oFSO.OpenTextFile(Fichier, ForReading)
Do Until oFile.AtEndOfStream
strName = oFile.ReadLine
If Not oDict.Exists(strName) Then oDict.Add(strName, strName)
Loop
oFile.Close()
oFile = oFSO.OpenTextFile(Fichier, ForWriting)
For Each maCle In oDict.Keys
oFile.WriteLine(maCle)
Next
oFile.Close()
End Sub |
Developpez.com décline toute responsabilité quant à l'utilisation des différents éléments téléchargés.