Sponsored Content
Top Forums Shell Programming and Scripting Script to convert csv file to html with good visibility Post 302710399 by rdrtx1 on Thursday 4th of October 2012 11:43:35 AM
Old 10-04-2012
if the % column is # 2 (otherwise change $pct_col):

Code:
 
#!/bin/ksh
perl -F',' -lane 'BEGIN{
$pct_col=2;
@bgc=("lightgreen","lightsteelblue");
open O, ">output_db.html"; print O "<html><body><table border=1><tbody>"
};
chomp;
print O "<tr>";
for $i (0..@F-1) {
   $cbgc=@bgc[$i % 2];
   if (${i} == ($pct_col - 1)) {
      $pct=@F[$i];
      $pct=~s/ *[%].*$//;
      $pct=~s/^ *//;
      $cbgc="red" if ($pct <= 20);
   }
   print O "<td bgcolor=" . $cbgc . " >@F[$i]<\/td>"
}
print O "<\/tr>";
END {print O "</tbody><\/table><\/body><\/html>"; close O}' DBA_CHECKS.csv


Last edited by rdrtx1; 10-04-2012 at 01:10 PM..
This User Gave Thanks to rdrtx1 For This Post:
 

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
opusdec(1)							    opus-tools								opusdec(1)

NAME
opusdec - decode audio from Opus format to WAV (or simple audio output) SYNOPSIS
opusdec [ -hv ] [ --mono ] [ --stereo ] [ --rate Hz ] [ --no-dither ] [ --packet-loss pct ] [ --save-range file ] input.opus [ output.wav ] DESCRIPTION
opusdec decodes Opus files into PCM Wave (uncompressed) files. If the input file is specified as - , then opusdec will read from stdin. Likewise, an output filename of - will cause output to be to std- out. If no output is specified opusdec will attempt to play the audio in realtime if it supports audio playback on your system. OPTIONS
-h, --help Print help message -v, --version Display version information --quiet Suppresses program output --mono Force decoding in mono --stereo Force decoding in stereo --rate Force decoding at sampling rate n Hz --no-dither Do not dither 16-bit output --packet-loss Simulate n % random Opus packet loss --save-range Saves check values for every frame to a file EXAMPLES
Decode a file input.opus to output.wav opusdec input.opus output.wav Play a file input.opus and force output at 48000 regardless of the original sampling rate (48kHz output may be faster, due to avoiding resampling and some sound hardware produces higher quality output when run at 48kHz) opusdec --rate 48000 input.opus Re-encode a high bitrate Opus file to a lower rate opusdec input.opus - | opusenc --bitrate 64 - output.opus Play an http stream http://icecast.somwhere.org:8000/stream.opus with the help of curl on a system with pulseaudio (press ctrl-c to quit) curl http://icecast.somwhere.org:8000/stream.opus | padsp opusdec - AUTHORS
Jean-Marc Valin <jmvalin@jmvalin.ca> Gregory Maxwell <greg@xiph.org> BUGS
Opusdec does not currently reject all invalid files which it should reject. It also doesn't provide very helpful output for the corrupted files it does reject. Use opusinfo(1) for somewhat better diagnostics. SEE ALSO
opusenc(1), opusinfo(1) Xiph.Org Foundation 2012-05-28 opusdec(1)
All times are GMT -4. The time now is 08:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy