Option Explicit
Private Sub Form_Load()
Dim intFF As Integer
Dim strReaded() As String
intFF = FreeFile
Open "c:\sample.txt" For Input As #intFF
strReaded = Split(Input(LOF(intFF), #intFF), vbLf)
Close #intFF
intFF = FreeFile
Open "c:\output.txt" For Output As #intFF
Print #intFF, Join(strReaded, vbCrLf);
Close #intFF
End Sub
The format of Windows and Unix text files differs slightly.
In Windows, lines end with both carriage-return (vbCr) and the line-feed (vbLf) ASCII characters. Actually there is a constant, vbCrLf, for this.
The Apple Macintosh, uses a carriage-return character only.
And finally Unix uses only a line feed.
As a consequence, some Windows applications will not show the line breaks in Unix-format/mac-format files. Likewise, Unix/Mac programs may display Windows text files incorrectly.
So when you open a text file saved in other format, you'll need to convert it in Windows format.