473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Colored line in the output file using perl

Hi Guys ,
Can u help me out in Pel Coding as i'm new to perl . Can any one of them say whether it to print a line in a colored way in the output file using Filehandler ..


Codin is :::
Open(OUTFILE, ">$curDir/file2.out");
print OUTFILE "$result1\n\n";
close(OUTFILE);
Jul 6 '07 #1
4 3240
numberwhun
3,509 Expert Mod 2GB
Perl can output text to a file for you, sure, but as far as providing color to that line? I don't have any clue about that. I would think that that would be up to the program being used to view the files as to whether or not to color a line, if it had that capability. If you think about it, viewing a file in notepad would only display the text, without formatting because it cannot.

Regards,

Jeff
Jul 6 '07 #2
KevinADC
4,059 Expert 2GB
Hi Guys ,
Can u help me out in Pel Coding as i'm new to perl . Can any one of them say whether it to print a line in a colored way in the output file using Filehandler ..
Short answer is no. If you are using a specific file format you would supply whatever code the file format recognizes to produce colored output. For example, if you were writing to an html file:

Expand|Select|Wrap|Line Numbers
  1. print OUTFILE "<span color=\"red\">$result</span>";
Jul 6 '07 #3
miller
1,089 Expert 1GB
Short answer is no.
The slightly longer answer is "hell no". Stay away from the pretty colors. They seduce you but they are a waste of time.

- Miller
Jul 6 '07 #4
KevinADC
4,059 Expert 2GB
The slightly longer answer is "hell no". Stay away from the pretty colors. They seduce you but they are a waste of time.

- Miller

I pretty much agree with you here. It's 99.99% a bad idea from the get-go (from the beginning).
Jul 6 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Robert | last post by:
I am using the php4-cgi Debian package which is based on PHP 4.3.4. I have problems when running php4 on the command line. If I say something like $ php4 index.cgi a number of variables...
1
by: Ben Floyd | last post by:
It goes like this: Im converting a perl script that executes a command on each result of a directory listing. In perl, all is well. In Python, using approximately the same logic creates a...
6
by: Eric Enright | last post by:
Could someone please tell me why this code doesn't work? ----- begin "line.pl" ----- #!/usr/bin/perl # output i'm expecting: # #-----begin----- #foreach $outerline (<FIN>) #{
14
by: Xah Lee | last post by:
is there a way to condense the following loop into one line? # -*- coding: utf-8 -*- # python import re, os.path imgPaths= # change the image path to the full sized image, if it exists
0
by: Anonieko Ramos | last post by:
> I have a graphics images that I want to convert to > ASCII art. How do I do it? > Code: - Default.aspx.cs
7
by: Rohan | last post by:
Hello, Can some one tell me how do I get colored text. Say when I want to write something in a text file , how do I get it colored.
8
by: mpatharkar | last post by:
Hi all, I have one input file "pick no.txt" from which i have to find perticuler pattern and print it in to output file "Numbers.txt". The input file is 1."pick no.txt" Number:
3
by: Gene Kelley | last post by:
Hello PHPers, I'm trying to get at a single line within a text file. For instance, I want to print the line within a the file named "file.txt" that starts with "17:". file.txt contains...
3
by: Sevla | last post by:
hello, im having a problem to change a particular word in a line, canīt find where is my mistake also i would like to know how to make this program check automatically if a particular word...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.