HTML color code and tabluar issue

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers HTML color code and tabluar issue
# 8  
Old 11-20-2016
Put it just in front of the if ($3+0 >= 400).
This User Gave Thanks to RudiC For This Post:
# 9  
Old 11-20-2016
Rudic, it worked perfect but color code as RED is not working, it is coming normal
# 10  
Old 11-20-2016
Try style="color:#FF0000"
# 11  
Old 11-20-2016
still same issue.
see if i am doing anything wrong
Code:
nawk '
BEGIN   {print "<br />\n<html>\n<Body>\n<table border=\"1\">"
        }
        {if ($3+0 >= 400 sub (/BAD REQUEST/, "BAD_REQUEST")) print "<tr style=\"color:#FF0000\">"
         else print "<tr>"
         for(i=1;i<=NF;i++)print "<td>" $i "</td>";
         print "</style /tr>"
        }
END     {print "</table>\n</Body>\n</html>\n<br />"
        }
' output.txt >output.html

# 12  
Old 11-20-2016
"in front of" means IN FRONT OF! Not AFTER

Code:
{sub (/BAD REQUEST/, "BAD_REQUEST")
 if ($3+0 >= 400) print "<tr style=\"color:#FF0000\">"
 else print "<tr>"

This User Gave Thanks to RudiC For This Post:
# 13  
Old 11-20-2016
I am sorry for the confusion,
now I am getting below error
Code:
nawk: syntax error at source line 4
 context is
                {sub (/BAD REQUEST/, "BAD_REQUEST") >>>  if <<<  ($3+0 >= 400)) print "<tr style=\"color:#FF0000\">"
nawk: illegal statement at source line 4
nawk: extra ) at source line 5
        extra )

---------- Post updated at 11:05 PM ---------- Previous update was at 11:01 PM ----------

I got it now dear. Thanks a TON
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cell color based on Status in HTML output

Hi, I need to get the Status Column in Green if it is approved and Red if it is declined in the HTML output attachment#!/bin/bash body_csv="/authlistener/ProdA/service/queryRS.csv" body_html="/authlistener/ProdA/service/queryRS.html" ... (1 Reply)
Discussion started by: maddelav
1 Replies

2. Shell Programming and Scripting

Add Color To html Doc

I have a script which converts a .csv file to html nicely. Trying to add 3 colors, green, yellow and red to the output depending upon the values in the cells. Tried some printf command but just can't seem to get any where. Any ideas would be appreciated. nawk 'BEGIN{ FS="," print ... (7 Replies)
Discussion started by: jimmyf
7 Replies

3. Shell Programming and Scripting

Issue to attachment with HTML body

HI Team, I used below code to get attachment with HTML body. i having21062013.csv file . but i am getting junk .csv file. Can you please help me out. export MAILTO=rp908@gmail.com.com export SUBJECT="Test Waiver Code email" export BODY=test.html export ATTACH=21062013.csv... (4 Replies)
Discussion started by: Jewel
4 Replies

4. Shell Programming and Scripting

Handle color code

p1=text1 p2=text2(in red color) when i am trying to replace $p1 with $p2, content of the file from text2 become red. so when i open that file using vi its showing color code before tex2. please suggest me how to omit that color code and make content of that file in default color? (1 Reply)
Discussion started by: Biplab
1 Replies

5. UNIX for Dummies Questions & Answers

Color code my vi

i am running under ssh i want to know how to make vi color code my bash scripting like how do i setup vim in ssh (1 Reply)
Discussion started by: jafa401
1 Replies

6. Solaris

Color issue

On most of my Sun Blade 100 and Ultra 5 systems running Solaris 9, I am having a problem with my video. The CDE looks fine but as soon as I open up Netscape 7 everything except the browser window changes to very bright and ugly colors. This is happening on multiple freshly installed systems w/... (1 Reply)
Discussion started by: meyersp
1 Replies
Login or Register to Ask a Question