Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Visual C++ Ver 5 Editor

Posted on 1998-02-06
Last Modified: 2010-04-10
System is WinNT4, and Win95.
I need a macro which saves text files (.cpp, .h, .rc2) in unix format?
or how can this be done?
Question by:twexperts
  • 3
  • 2
LVL 22

Expert Comment

ID: 1180967
What do you mean by unix format?  

Author Comment

ID: 1180968
By unix format, I mean in unix you view a dos file and it has at the end of every line a ^M character.
This is because dos sends a carriage return & line feed at the end of every line. Where as unix only does one of them (Carriage return), anyway the codes are 010 and 013, and VBscript in VC++5 does have the constants vbCr and vbCrLf (also vbLf). Does that make things a bit clearer?
LVL 22

Expert Comment

ID: 1180969
makes sense.  But I suspect that you can't make vissual C save files in a "unix" format.  Your best bet will probably be to write a c program to convert from one format to the other.  It should be pretty easy.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.


Author Comment

ID: 1180970
Yes we do have unix and dos scripts that do it, but rather than calling the scripts x thousand times when we do a full recompile, it would be better to solve the problem at the source, i.e. save the files in unix format. :)

Accepted Solution

shogi earned 100 total points
ID: 1180971
you need to take _read() and _write() fonction this function don't perform the translation 10+13. But because your file already having 10+13 in your Text file you have to translate each  10+13 in 10 (if it's needed) and use _write() to create you new file.  I use that for binary file, but UNIX to WIN.

Author Comment

ID: 1180972
Could you give a bit more detail on using these functions, i.e. scanning the file, replacing chars, and then writing the file... And are you sure that the write() call doesn't append the end of line codes to each line?

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question