rudyperray
Messages postés7Date d'inscriptionmardi 17 mai 2005StatutMembreDernière intervention 3 juin 2007
-
19 mai 2005 à 20:05
nawakator
Messages postés51Date d'inscriptionlundi 12 mai 2003StatutMembreDernière intervention 8 février 2011
-
19 mai 2005 à 20:47
Je voudrais faire un outil en VB ou VBA (dans le cadre de mon travail )qui permette de trouver les
différences qu'il y a entre 2 fichiers texte 1 et 2 qui fonctionnent
par lignes
ex:
XX01 XXXX YYYY ZZZ
TEXT
XX
XX10 XXXX YYY ZZZ
TEXT
YY
Je récupererais les lignes différentes dans un autre
fichier texte "résultat"!
un peu comme WinDiff de windows
Etant très novice en VB j'aurais besoin de votre aide !!
nawakator
Messages postés51Date d'inscriptionlundi 12 mai 2003StatutMembreDernière intervention 8 février 2011 19 mai 2005 à 20:47
Voici un petit code
Option Explicit
-----------------------------
Dim i As Integer
Dim j As Integer
Dim file1 As String
Dim file2 As String
Dim strData1 As String
Dim strData2 As String
file1 = "C:\File1.txt"
file2 = "C:\File2.txt"
i = FreeFile
Open file1 For Binary As i
j = FreeFile
Open file2 For Binary As j
Do While Not EOF(i) And Not EOF(j)
strData1 = " "
strData2 = " "
Get i, , strData1
Get j, , strData2
If strData1 <> strData2 Then
MsgBox "c'est différent"
Exit Do
End If
Loop