Results 1 to 2 of 2

Thread: Quick question... thanks

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    99
    How can I delete the first line of text in a .txt file, then save it... ??? thanks
    ___________________________
    Chris

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Try something like:
    Code:
    Private Sub Command1_Click()
        Dim iFile As Integer
        Dim sFileData As String
        
        iFile = FreeFile
        Open "C:\TheFile.txt" For Binary Access Read As iFile
        sFileData = Space(LOF(iFile))
        Get #iFile, , sFileData
        Close iFile
        
        iFile = FreeFile
        Open "C:\TheFile.txt" For Output As iFile
        Print #iFile, Mid(sFileData, InStr(sFileData, vbCrLf) + 2);
        Close iFile
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width