Convert UNIX files to DOS files and vice versa

By | 2002-04-19

This code converts UNIX files to DOS files and DOS files to UNIX files

Original Author: David Gabrielsen

Inputs

the text to be converted

Assumptions

This code has 2 Functions. One function that takes a DOS string as argument and returns a UNIX string, and one function that takes a UNIX string as argument and returns a DOS string.

Returns

UNIX or DOS text

Side Effects

absolutely none

Code

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

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.