This is your problem:
TotalFile = TotalFile & FileData & vbCrLf
Try:
Code:Dim m_filename As String Dim FileData As String Dim TotalFile() As String Dim result() as string Dim final as string Open m_filename For Input As #1 FileData = input(lof(1),1) close #1 totalfile = split(filedata,vbcrlf) ' an array of lines for x = 1 to ubound(totalfile) if totalfile(x) > "" then Redim Preserve result(ubound(result)+1) result(ubound(result)) = totalfile(x) & vbCrLf end if next x final = Join(result) ' final is now one giant string, like your old totalfile was




Reply With Quote