05-06-2009
text color
Hi all
I have a file contains columns showing figures as below :
Input file
A B C
D 50 60 90
E 100 20 53
F 30 40 70
G 25 27 45
I want to color the value above or equal 90 by red and to be shown as below
output file
A B C
D 50 60
90
E
100 20 53
F 30 40 70
G 25 27 45
I have used awk command but i fail to get it works
awk '{for(i=2;i<=NF;i++) if ($i >= 90) printf ("%s ","\033[31m"$i"\033[0m");else printf("%s ",$i);printf "\n"}' inputfile
can anybody help me with this...Thanx
7 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I want to change the color of the text. Currently, I am using the following VT100 command, which changes the color of the foreground:
<ESC>[{attr1};...;{attrn}m
The problem is, when I change the color of the foreground, it changes the color of the text as expected, but it also... (4 Replies)
Discussion started by: Abed Alnaif
4 Replies
2. UNIX for Dummies Questions & Answers
Hi Gurus,
I have a small requirement where i want to change the color & font of some text in a file.
i have a file error.txt which will be created in the script using egrep.
After that iam adding these lines at head & tail to that file using the following code
awk 'BEGIN{print"Please... (4 Replies)
Discussion started by: pssandeep
4 Replies
3. Shell Programming and Scripting
Good morning,
Can someone help to color a figure in columns if its exceeding a threshold using shell script .
ex. I have file contains 5 columns showing a value in % I need to show the value in red if it exceed 90 %
Appreciate your help (3 Replies)
Discussion started by: Bluetoot
3 Replies
4. Red Hat
Hi. How do I change the background color and text in Fedora. I did find the set_color -b command.
Thanks (1 Reply)
Discussion started by: Ccccc
1 Replies
5. Programming
I'm writing my own Unix ls command in c and I was wondering if anyone knows how to or can point me to a tutorial that shows me how to change the text color of the filename depending on if it's a directory, regular file, linked file, etc..., like the real ls command does? Thanks. (4 Replies)
Discussion started by: snag49ers
4 Replies
6. AIX
I want to color the text and bold the text and mail these text.
input:
hi..(in bold)
good morning (in blue color)
and mail these as in color and bold
:wall: (1 Reply)
Discussion started by: AhmedLakadkutta
1 Replies
7. AIX
Hi
I'd like to print color text and I've tried this: echo "\033but it didn't woked. When I changed 0 --> 1/4/5, the text "HI" --> bold/underline/blink, but when I changed 31 or 33 to other values, the color didn't change.
What's the problem. Need to install something ??? (8 Replies)
Discussion started by: bobochacha29
8 Replies
LEARN ABOUT SUSE
glcolormask
GLCOLORMASK(3G) GLCOLORMASK(3G)
NAME
glColorMask - enable and disable writing of frame buffer color components
C SPECIFICATION
void glColorMask( GLboolean red,
GLboolean green,
GLboolean blue,
GLboolean alpha )
PARAMETERS
red, green, blue, alpha
Specify whether red, green, blue, and alpha can or cannot be written into the frame buffer. The initial values are
all GL_TRUE, indicating that the color components can be written.
DESCRIPTION
glColorMask specifies whether the individual color components in the frame buffer can or cannot be written. If red is GL_FALSE, for exam-
ple, no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted.
Changes to individual bits of components cannot be controlled. Rather, changes are either enabled or disabled for entire color components.
ERRORS
GL_INVALID_OPERATION is generated if glColorMask is executed between the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_COLOR_WRITEMASK
glGet with argument GL_RGBA_MODE
SEE ALSO
glClear(3G), glColor(3G), glColorPointer(3G), glDepthMask(3G), glIndex(3G), glIndexPointer(3G), glIndexMask(3G), glStencilMask(3G)
GLCOLORMASK(3G)