0
我現在在刪除文本文件中的行時出現問題,刪除了文本文件中的一行字符串後,在其上留有空白區域。這是我的代碼。感謝您幫助我們。在刪除文本文件中的行後刪除空白VB6
iFileList = FreeFile
iFileList2 = FreeFile
Open App.Path & "\months\" & gMonth & ".txt" For Input As #iFileList
Do While Not EOF(iFileList)
Line Input #iFileList, sLine
tempHolder2 = Split(sLine, "/")
If Len(sLine) > 0 Then
If gDay = tempHolder2(0) Then
If tempHolder2(1) Like lvAlarm.selectedItem Then
'skip the line
Else
sNewText = sNewText & sLine & vbCrLf
End If
End If
End If
Loop
Close
Debug.Print (sNewText)
iFile = FreeFile
Open App.Path & "\months\" & gMonth & ".txt" For Output As #iFile
'sNewText = sNewText & vbCrLf
Print #iFile, Trim(sNewText)
Close