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
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