VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Convert UNIX files to DOS files and vice versa

by David Gabrielsen (2 Submissions)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

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

Inputs
the text to be converted
Assumes
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.
Code Returns
UNIX or DOS text
Side Effects
absolutely none

Rate Convert UNIX files to DOS files and vice versa

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

Download this snippet    Add to My Saved Code

Convert UNIX files to DOS files and vice versa Comments

No comments have been posted about Convert UNIX files to DOS files and vice versa. Why not be the first to post a comment about Convert UNIX files to DOS files and vice versa.

Post your comment

Subject:
Message:
0/1000 characters