Fork me on GitHub

736 bytes of Visual Basic

1234567891011121314151617181920212223242526272829303132

Sub incorporerFichier2()
 Dim                i As Integer
 Dim monNomFichier(2) As String, maChaine(1) As String

 monNomFichier(0) = "L:\Traités anciens\Roubo\exportTdM.htm.txt"
 monNomFichier(1) = "L:\Traités anciens\Roubo\tdm2.htm.txt"
 monNomFichier(2) = "L:\Traités anciens\Roubo\tdm3.htm.txt"

 Open monNomFichier(0) For  Input As #1
 Open monNomFichier(1) For  Input As #2
 Open monNomFichier(2) For Output As #3

 While not eof(1)
  maChaine(0) = "" : maChaine(1) = ""
  Line Input #1, maChaine(0)
  While (maChaine(0) <> maChaine(1))
   Line Input #2, maChaine(1)
   print #3, maChaine(1)
  Wend

  For i = 1 to 5
   Line Input #1, maChaine(0)
   Print #3, maChaine(0)
  Next i
 Wend

 Close #3
 Close #2
 Close #1
End Sub