SUPINFO International University

SUPINFO Institute of Information Technology
Laboratoire Microsoft




Supprimer du texte en double dans un fichier texte

Accueil > Script > maintenance > Supprimer du texte en double dans un fichier texte

Supprimer du texte en double dans un fichier texte

Par Alexandre VILLOING, LABORATOIRE SUPINFO DES TECHNOLOGIES MICROSOFT
Publiée le 25/04/2005 vers 1h.

Const ForReading = 1
Const ForWriting = 2

Set objDictionary = CreateObject("Scripting.Dictionary")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile _
("c:\scripts\namelist.txt", ForReading)

Do Until objFile.AtEndOfStream
strName = objFile.ReadLine
If Not objDictionary.Exists(strName) Then
objDictionary.Add strName, strName
End If
Loop

objFile.Close

Set objFile = objFSO.OpenTextFile _
("c:\scripts\namelist.txt", ForWriting)

For Each strKey in objDictionary.Keys
objFile.WriteLine strKey
Next

objFile.Close



Proposer un script

Notre avis :

Votre avis :

Réactions :
0

Votants :
1

Visites :
10526

1
2
3
4
5




Retrouvez ci-dessous les autres sections du Laboratoire Microsoft