Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix to Dos text file

Status
Not open for further replies.

bytehead

Programmer
Jul 12, 2001
25
0
0
US
I have a text file generated on a Unix platform. When accessing this file for processing using Visual Basic 6.0, I do not get the needed cariage returns to designate each line of text in the file.

Unix has a command which adds the needed cariage returns, but I am not moving the files from the Unix side until they process through the application correctly.

My question is, is there any Windows 2000 system call which will do this or functionallity in Visual Basic which allows a file to be opened as ASCII text automatically?
 
I think maybe the file contains carriage returns, but not linefeeds. Look for chr$(13)'s Peter Meachem
peter@accuflight.com
 
Hi
You are probably looking for a solution that is a bit
less work than this, but anyway...

In VB you could read the file into a string and then
use the replace function to replace each occurrence
of line feed with a carriage return & line feed.
e.g.
strFileData = Replace(strFileData, vbLf, vbCrLf)

Then write the string back to file...
Does this help?
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top