1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Dim fics, desti As String, n As Integer, lgt As Long, lgb As Long, nb As Long, reste As Long, k As Long, titi As String
lgb = 30000 ' ----->> taille de bloc à traiter (à à mettre à la valeur de votre choix ...)
fics = Array("d:\fic1.txt", "d:\fic2.txt", "d:\fic3.txt")
desti = "d:\desti.txt"
If Dir(desti, vbHidden Or vbNormal) <> "" Then Kill desti
Open desti For Append As #2
For n = 0 To UBound(fics)
Open fics(n) For Input As #1
lgt = LOF(1): nb = lgt \ lgb: reste = lgt Mod lgb
For k = 1 To nb
titi = Input(lgb, #1): Print #2, titi;
Next
titi = Input(reste, #1)
If Right(titi, 2) = vbCrLf Then titi = Left(titi, Len(titi) - 2)
Print #2, titi
Close #1
DoEvents
Next
Close #2 |
Partager