```
Sub Demo1r()
Const E = ".txt"
Dim F%, P$, N$, SPQ$(), T$, C&, R&
F = FreeFile
P = ThisWorkbook.Path & Application.PathSeparator
N = Dir(P & "*" & E)
While N > ""
Open P & N For Input As #F
SPQ = Split(Input(LOF(F), #F), vbCrLf)
Close #F
If UBound(SPQ) > 5 Then
T = Replace(N, E, "")
If Right(SPQ(6), Len(T)) <> T Then
C = C + 1
Open P & N For Output As #F
For R = 0 To 5: Print #F, SPQ(R): Next
For R = 6 To UBound(SPQ) - 1: Print #F, SPQ(R); Spc(4); T: Next
Print #F, SPQ(R); Spc(4); T;
Close #F
End If
End If
N = Dir
Wend
MsgBox "Mod # : " & C, vbInformation, " Demo1r"
End Sub
```