Re: Convert UNIX to DOS file
Private Function convertDOStoUNIX(DOSstring As String) As String
convertDOStoUNIX = Replace(DOSstring, vbCrLf, vbLf, 1, Len(DOSstring), vbTextCompare)
End Function
Private Function convertUNIXtoDOS(UNIXstring As String) As String
convertUNIXtoDOS = Replace(UNIXstring, vbLf, vbCrLf, 1, Len(UNIXstring), vbTextCompare)
End Function
Iouri Boutchkine
[email protected]
Re: Convert UNIX to DOS file
I don't think it's necessary to do the conversion at all. A UNIX file should have a line feed, if you use the FileSystemObject and the ReadLine method it will only pick up one line.
Set a reference to Microsoft Scripting Runtime.
Code would look like this:
Dim FSO as new FileSystemObject
Dim fsoStream as TextStream
Dim strLine as string
set fsoStream = FSO.OpenTextFile(YourFileName with full path here)
Do Until fsoStream.AtEndOfFile = true
strLine = fsoStream.ReadLine
Loop
fsoStream.Close
set FSO = nothing
That should do it.
Re: Convert UNIX to DOS file