VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Remove the excess blank line in a text file

by nandhini (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Tue 28th November 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Remove the excess blank line in a text file

API Declarations


Dim fill As File
Dim ts As TextStream
Dim s, c As String


Rate Remove the excess blank line in a text file



   If FN <> "" Then
        Set fill = fsyo.GetFile(FN)
        Set ts = fill.OpenAsTextStream(ForReading)
        s = ts.ReadAll
        c = vbNewLine + vbNewLine
        d = vbNewLine + " "
        s = Replace(s, c, vbNewLine)
        s = Replace(s, d, vbNewLine)
    
        ts.Close
        Set ts = fill.OpenAsTextStream(ForWriting)
        ts.Write s
        ts.Close
    End If

Download this snippet    Add to My Saved Code

Remove the excess blank line in a text file Comments

No comments have been posted about Remove the excess blank line in a text file. Why not be the first to post a comment about Remove the excess blank line in a text file.

Post your comment

Subject:
Message:
0/1000 characters