Is there a way to output text to a file in different colors on Linux?

I am outputting data to a txt file on Linux using C++. Is there a way to output a portion of a line of text in a different color?

For example, I'd like to be able to write 0.000 Watts in red.

Total Power Usage of this model: 0.000 Watts

Answers


Plain text files (*.txt) don't support color in any way. You will have to use a different format, such as RTF or HTML.


Need Your Help

Having trouble building project on eclipse cdt? G++ no found!

gcc mingw eclipse-cdt

I installed Eclipse CDT C/C++ and MinGW. But I cant build hello world program. The following message appears in the console.

calculating a function in matlab with very small values

matlab precision exponential epsilon

I am making a function in matlab to compute the following function:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.