Titre: Fichier texte vers htm.
Description:
Convertit un fichier teste au format htm.
Le code:
Private Sub Command1_Click() Dim U As Integer, V As Integer, T As String, I As Integer Dim TxtOut As String, TxtTmp As String Dim FchrInp$, FchrOut$ FchrInp = "Fichier texte.txt" FchrOut = "Fichier htm.htm" U = FreeFile Open FchrInp For Input As #U V = FreeFile Open FchrOut For Output As #V While Not EOF(U) Line Input #U, T TxtTmp = txt2Html(T) TxtOut = "" For I = 1 To Len(TxtTmp) If Mid$(TxtTmp, I, 1) = Chr$(32) Then TxtOut = TxtOut + " " Else TxtOut = TxtOut + Mid$(TxtTmp, I, 1) End If Next I Print #V, TxtOut & "<BR>" Wend Close #V Close #U End Sub |