Private Sub ReadWriteFile2() Dim strg As String Dim allstr As String Dim nfile As Integer Dim firstline As Boolean firstline = True iter = 0 nfile = FreeFile allstr = "" Open "E:\ReadFile\TEXT2.TXT" For Input As #nfile Do While Not EOF(nfile) Line Input #nfile, strg If Not firstline Then allstr = allstr + strg End If firstline = False Loop Close #nfile nfile = FreeFile Kill "E:\ReadFile\TEXT2.TXT" Open "E:\ReadFile\TEXT2.TXT" For Append Shared As #nfile Print #nfile, allstr Close #nfile End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub ReadWriteFile2() Dim strg As String Dim allstr As String Dim nfile As Integer Dim firstline As Boolean firstline = True iter = 0 nfile = FreeFile allstr = "" Open "E:\ReadFile\LICENSE.TXT" For Input As #nfile Do While Not EOF(nfile) Line Input #nfile, strg If Not firstline Then allstr = allstr + strg + vbCrLf End If firstline = False Loop Close #nfile nfile = FreeFile Open "E:\ReadFile\LICENSE.TXT" For Output As #nfile Print #nfile, allstr Close #nfile End Sub