color a figure in text file

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

Using ANSI color, to display on your terminal.

awk '{for(i=1;i<=NF;i++)if ($i > 90)printf("%s ","\033[31m"$i"\033[0m");else printf("%s ",$i);printf "\n"}' filename

cheers,
Devaraj Takhellambam

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

Appreciate if i could find an answer to my request..
Thanx n advance