Open MonFichier For Input As #1 Open MonFichier2 For Output As #2 Do Until EOF(1) Line Input #1, Ligne Nom = Mid(Ligne, 1, 5) If Nom <> "TOTOT" Then Print #2, Ligne Loop Close Kill MonFichier Name MonFichier2 As MonFichier
Dim tmp As String Dim x As Integer Dim x1 As Integer Dim x2 As Integer Open Monfichier For Binary As #1 tmp = Space$(LOF(1)) Get #1, , tmp Close #1 x = InStr(tmp, "TOTOT") If x > 0 Then x1 = InStrRev(tmp, vbCrLf, x) x2 = InStr(x, tmp, vbCrLf) Kill Monfichier Open Monfichier For Binary As #2 Put #2, , Left$(tmp, x1 + 1) Put #2, , Mid$(tmp, x2 + 2) Close #2 End If