Sponsored Content
Top Forums Shell Programming and Scripting Script to convert csv file to html with good visibility Post 302710311 by sv0081493 on Thursday 4th of October 2012 08:04:38 AM
Old 10-04-2012
Script to convert csv file to html with good visibility

Hi,

I have Below script which converts csv file to html succesfully.but the visiblity is simple in black n white. I want to have better visibilty of each columns in different colours(like green).As it is a Database report suppose some tablespace available space is less than 20% then it should come up in red colour.If the available space is above 20% then it should come up in green.

Code:
perl -F',' -lane 'BEGIN{open O, ">output_db.html"; print O "<html><body><table border=1>"}; chomp;
print O "<tr>";
print O "<th>$_<\/th>" for (@F);
print O "<\/tr>";
END {print O "<\/table><\/body><\/html>"; close O}' DBA_CHECKS.csv


Your prompt help is much appreciated.

Moderator's Comments:
Mod Comment Please stop using ALL CAPS for your subject titles, and use code tags. Thanks


Moderator's Comments:
Mod Comment And while you're at it, please stop double posting and post in the currect forum.

Last edited by Scott; 10-04-2012 at 09:17 AM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sample Unix script file to convert .xml to .csv

Dear all, Can you send me a script file the changes .xml to .csv file. Thanks, Srinivasa (4 Replies)
Discussion started by: srinivasaphani
4 Replies

2. UNIX for Dummies Questions & Answers

Unix script to convert .csv file to.xls format

I have a .csv file in Unix box i need a UNIX script to convert the.csv files to.xls format. Its very urgent please help me. (1 Reply)
Discussion started by: moon_friend
1 Replies

3. UNIX for Dummies Questions & Answers

convert csv to html file

Hi All, I am new to this forum,not sure where to post this query...so posted here Kindly need any of your help on the below ------------ I am using shell scripting and trying to convert a csv file to html file... example.csv --------------- Name Country Age Sex Andy India 25 ... (4 Replies)
Discussion started by: sumithra
4 Replies

4. Shell Programming and Scripting

Is there any script which convert binary file to CSV format

Dear guys; I have a binary file and I need to convert its data to csv format ...appreciating your help. Best Regards (14 Replies)
Discussion started by: ahmad.diab
14 Replies

5. Shell Programming and Scripting

Awk script to convert csv to html

Hi Written some script to convert csv to html but could not add table headers.Below are the errors iam getting ./csv2html | more + awk -v border=1 -v width=10 -v bgcolor=black -v fgcolor=white BEGIN { printf("<table border=\"%d\" bordercolor=\"%s\" width=\"%d\"... (2 Replies)
Discussion started by: zeebala1981
2 Replies

6. Shell Programming and Scripting

Convert shell script output txt file to html table

Hi, I have script which generates the output as below: Jobname Date Time Status abc 12/9/11 17:00 Completed xyz 13/9/11 21:00 Running I have the output as a text file. I need to convert it into a HTML Table and sent it thru email ... (6 Replies)
Discussion started by: a12ka4
6 Replies

7. Shell Programming and Scripting

Script to convert CSV file to HTML

Hi, I have made a a script which creates a csv file as daily database report However i want to covert that csv file to html because csv file does not have a good visibilty. So it is possible to have such csv to html coversion script. Your prompt help much appreciated. Thanks in advance (4 Replies)
Discussion started by: sv0081493
4 Replies

8. Shell Programming and Scripting

Need script to convert TXT file into CSV

Hi Team, i have some script which give output in TXT format , need script to convert TXT file into CSV. Output.TXT 413. U-UU-LVDT-NOD-6002 macro_outcome_dist-8.0.0(v1_0_2) KK:1.2.494 (1234:333:aaa:2333:3:2:333:a) 414. U-UU-LVDT-NOD-6004 ... (10 Replies)
Discussion started by: Ganesh Mankar
10 Replies

9. Shell Programming and Scripting

Convert shell script output txt file to html table

My concnern related to the post -Convert shell script output txt file to html table, in this how to print the heading as color. awk 'BEGIN{print "<table>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table>"}' <filename> (8 Replies)
Discussion started by: sarajobmai
8 Replies

10. Shell Programming and Scripting

Convert csv data to html format

I am new to html and need to convert the attached csv file data to html format ; running into issues. please assist. #!/bin/ksh echo "<html>" ; echo "<head><style> table {border-collapse: collapse;} table, td, th {border: 1px solid black;} </style></head>" echo "<title> REPORT </title>" echo... (0 Replies)
Discussion started by: archana25
0 Replies
secolor.conf(5) 						File Formats Manual						   secolor.conf(5)

NAME
secolor.conf - The SELinux color configuration file. DESCRIPTION
This optional file controls the color to be associated to the context components associated to the raw context passed by selinux_raw_con- text_to_color(3), when context related information is to be displayed in color by an SELinux-aware application. selinux_raw_context_to_color(3) obtains this color information from the active policy secolor.conf file as returned by selinux_col- ors_path(3). FILE FORMAT
The file format is as follows: color color_name = #color_mask [...] context_component string = fg_color_name bg_color_name [...] Where: color The color keyword. Each color entry is on a new line. color_name A single word name for the color (e.g. red). color_mask A color mask starting with a hash (#) that describes the hexadecimal RGB colors with black being #000000 and white being #ffffff. context_component The context component name that must be one of the following: user, role, type or range Each context_component string ... entry is on a new line. string This is the context_component string that will be matched with the raw context component passed by selinux_raw_context_to_color(3). A wildcard '*' may be used to match any undefined string for the user, role and type context_component entries only. fg_color_name The color_name string that will be used as the foreground color. A color_mask may also be used. bg_color_name The color_name string that will be used as the background color. A color_mask may also be used. EXAMPLES
Example 1 entries are: color black = #000000 color green = #008000 color yellow = #ffff00 color blue = #0000ff color white = #ffffff color red = #ff0000 color orange = #ffa500 color tan = #D2B48C user * = black white role * = white black type * = tan orange range s0-s0:c0.c1023 = black green range s1-s1:c0.c1023 = white green range s3-s3:c0.c1023 = black tan range s5-s5:c0.c1023 = white blue range s7-s7:c0.c1023 = black red range s9-s9:c0.c1023 = black orange range s15:c0.c1023 = black yellow Example 2 entries are: color black = #000000 color green = #008000 color yellow = #ffff00 color blue = #0000ff color white = #ffffff color red = #ff0000 color orange = #ffa500 color tan = #d2b48c user unconfined_u = #ff0000 green role unconfined_r = red #ffffff type unconfined_t = red orange user user_u = black green role user_r = white black type user_t = tan red user xguest_u = black yellow role xguest_r = black red type xguest_t = black green user sysadm_u = white black range s0:c0.c1023 = black white user * = black white role * = black white type * = black white SEE ALSO
selinux(8), selinux_raw_context_to_color(3), selinux_colors_path(3) SELinux API documentation 08 April 2011 secolor.conf(5)
All times are GMT -4. The time now is 07:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy