Bonjour a tous,
j'ai besoin de creer une Boucle pour parcourir tous les ligne de la liste de mon fichier text, j'arrive a boucler sur toute une ligne mais pas sur tout les ligne!! voila mon code si pouvez m'aider,
merci.


Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
Dim Ligne As String
Dim Fichier As String
Dim New As Integer
Dim Last As Integer
Dim oResult As Object
Dim i As Integer
Dim st As String
Dim N As Integer
 
Fichier = "C:\Dossier\fichier1.txt"
 
Open Fichier For Input As #1
    ' Boucle sur les lignes du fichier
    Do While Not EOF(1)
        Line Input #1, Ligne
        'MsgBox Ligne
' N = Count 'Ligne(Count) ' c'est la que j'essaye de boucler sur tte les ligne !!
        Last = 0
        Set oResult = New Collection
        For i = 1 To Len(Ligne)
            New = InStr(Last + 1, Ligne, ";")
            If New = 0 Then
                Exit For
            Else
                st = Mid(Ligne, Last + 1, New - Last - 1)
                oResult.Add st, CStr(i) ' "ATT1" + "ATT2"
                Last = New
            End If
        Next
    Loop
Close #1
 
End Sub