Sponsored Content
Full Discussion: color a figure in text file
Top Forums Shell Programming and Scripting color a figure in text file Post 302312870 by Bluetoot on Monday 4th of May 2009 01:07:42 AM
Old 05-04-2009
Thanx for your reply.... But it dose not work .. It seems that it copy the strings of the color to the figure ... I have change the threshold from 90 to 20 just for test..
awk '{for(i=1;i<=NF;i++)if ($i >= 20)printf("%s "," \033[31m"$i"\033[0m");else printf("%s ",$i);printf "\n"}' test_mai

Answer:

\033[31m29\033[0m \033[31m38\033[0m 19 \033[31m37\033[0m
\033[31m43\033[0m \033[31m31\033[0m \033[31m32\033[0m 12
\033[31m38\033[0m \033[31m30\033[0m 19 \033[31m35\033[0m
\033[31m26\033[0m \033[31m27\033[0m \033[31m23\033[0m \033[31m21\033[0m
\033[31m22\033[0m \033[31m21\033[0m \033[31m27\033[0m \033[31m24\033[0m
\033[31m26\033[0m \033[31m24\033[0m \033[31m20\033[0m \033[31m24\033[0m
\033[31m28\033[0m \033[31m30\033[0m \033[31m25\033[0m \033[31m21\033[0m
\033[31m25\033[0m \033[31m27\033[0m 18 \033[31m22\033[0m
\033[31m27\033[0m \033[31m30\033[0m \033[31m26\033[0m \033[31m25\033[0m
\033[31m29\033[0m \033[31m30\033[0m \033[31m20\033[0m \033[31m26\033[0m
\033[31m25\033[0m \033[31m24\033[0m \033[31m23\033[0m \033[31m21\033[0m
\033[31m32\033[0m \033[31m31\033[0m \033[31m20\033[0m \033[31m26\033[0m
\033[31m34\033[0m \033[31m29\033[0m \033[31m30\033[0m \033[31m39\033[0m
\033[31m25\033[0m \033[31m20\033[0m 15 12
\033[31m37\033[0m \033[31m30\033[0m \033[31m38\033[0m \033[31m42\033[0m
\033[31m24\033[0m \033[31m26\033[0m 18 18
\033[31m29\033[0m \033[31m23\033[0m \033[31m26\033[0m 17
\033[31m24\033[0m \033[31m28\033[0m 18 \033[31m25\033[0m
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

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... (5 Replies)
Discussion started by: Bluetoot
5 Replies

2. Red Hat

New Background and Text Color

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

3. Programming

changing text color in c

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

4. Shell Programming and Scripting

change text color in postscript file

Hi everyone, I have a program that produces postscript files on the fly The color of the files produced are in black and white I want to change the text color of postscript file as the file is being produced without having to manually go into the ps file and change it myself. Any Ideas?... (5 Replies)
Discussion started by: walforum
5 Replies

5. AIX

How to color text and mail

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

6. Shell Programming and Scripting

Color text on shell programming

hello i need the main reference for color code on shell programing i know a few color like: RED='\033 (2 Replies)
Discussion started by: nimafire
2 Replies

7. Shell Programming and Scripting

Help with change significant figure to normal figure command

Hi, Below is my input file: Long list of significant figure 1.757E-4 7.51E-3 5.634E-5 . . . Desired output file: 0.0001757 0.00751 0.00005634 . . . (10 Replies)
Discussion started by: perl_beginner
10 Replies
IMAGICK.WHITETHRESHOLDIMAGE(3)						 1					    IMAGICK.WHITETHRESHOLDIMAGE(3)

Imagick::whiteThresholdImage - Force all pixels above the threshold into white

SYNOPSIS
bool Imagick::whiteThresholdImage (mixed $threshold) DESCRIPTION
Is like Imagick::ThresholdImage() but force all pixels above the threshold into white while leaving all pixels below the threshold unchanged. PARAMETERS
o $threshold - RETURN VALUES
Returns TRUE on success. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 2.1.0 | | | | | | | Now allows a string representing the color as a | | | parameter. Previous versions allow only an Imag- | | | ickPixel object. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 Imagick.whiteThresholdImage(3) <?php function whiteThresholdImage($imagePath, $color) { $imagick = new Imagick(realpath($imagePath)); $imagick->whiteThresholdImage($color); header("Content-Type: image/jpg"); echo $imagick->getImageBlob(); } ?> PHP Documentation Group IMAGICK.WHITETHRESHOLDIMAGE(3)
All times are GMT -4. The time now is 03:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy