![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| color a figure in text file | Bluetoot | Shell Programming and Scripting | 3 | 05-04-2009 11:25 AM |
| Changing text color in existing xterm or dtterm | fjc | UNIX for Advanced & Expert Users | 1 | 03-06-2009 04:07 AM |
| How to change the font or color of text | pssandeep | UNIX for Dummies Questions & Answers | 4 | 12-18-2007 06:15 PM |
| Changing Text Color Using VT100 | Abed Alnaif | UNIX for Advanced & Expert Users | 4 | 11-27-2006 04:10 PM |
| how to disable color text in xterm window | modemer | UNIX for Dummies Questions & Answers | 1 | 06-06-2005 09:20 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 ![]() |
|
||||
|
I have got the below output
Note: I have changed 90 by 20 for test only \033[31m38\033[0m 19 \033[31m37\033[0m \033[31m31\033[0m \033[31m32\033[0m 12 \033[31m30\033[0m 19 \033[31m35\033[0m \033[31m27\033[0m \033[31m23\033[0m \033[31m21\033[0m \033[31m21\033[0m \033[31m27\033[0m \033[31m24\033[0m \033[31m24\033[0m \033[31m20\033[0m \033[31m24\033[0m \033[31m30\033[0m \033[31m25\033[0m \033[31m21\033[0m \033[31m27\033[0m 18 \033[31m22\033[0m \033[31m30\033[0m \033[31m26\033[0m \033[31m25\033[0m \033[31m30\033[0m \033[31m20\033[0m \033[31m26\033[0m \033[31m24\033[0m \033[31m23\033[0m \033[31m21\033[0m \033[31m31\033[0m \033[31m20\033[0m \033[31m26\033[0m Any idea... |
|
||||
|
Thanx everyone for your contrbution..
I tried the command with another server and it works perfect.. Any one has an idea what could be the reason that command not working in my first unix box.. Is there anything that i can check in advance? Appreciated |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|