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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change colour of characters in text?

Status
Not open for further replies.

tujchl

Technical User
Sep 7, 2008
7
CN
Hi everyone:
I want to change character colour in text, but I didn`t find suitable module for this task. if you know which module can do it in a text file, not in screen ouput. please tell me, thanks :)
 
There is no such thing as color in a text file. Color only applies to the visual media used, like the monitor screen or a web browser. The file can contain the information used to display the color when the file/document is viewed, but you did not mention what file format you are working with.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
thank you for your reply :)
I want to change character colour in txt or rtf file.
do you know how to do it, thanks again :)
 
Try RTF::Writer:


Or search CPAN for "RTF" if you wanna find something different.

Plain text documents don't support text colors. The only exception would be if you're talking about ANSI escape sequences... but, in Notepad or any text editing program these will show up as block symbols and not affect the color of the text, and are only good for programs like "less" or "more" when you give them the option to have them process escape characters for display instead of escaping them. But this is such an obscure use that I don't think it needs to be discussed further. See Term::ANSIColor if curious.

-------------
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top