Sponsored Content
Top Forums Shell Programming and Scripting awk to create two HTML Tables Post 302537639 by ananthap on Friday 8th of July 2011 10:40:37 PM
Old 07-08-2011
Basically, accumulate in the main loop and write in END{} function.

This is standard in HTML to avoid multiple passes on the data.

I've not gone into details of the exact script, but it should be straight forward.

In BEGIN{}, assign the two table's header to strings thus:
strA="<table width=\"100%\" border=0><tbody><tr><th align=center><font size=+1><b>Array Size Report</b></font></th></tr>"
strB="<table width=\"100%\" border=\"1\">\n<tbody><tr><th align=\"center\">GRP-
Bunch ID</th><th align=\"center\">GRP Type</th><th align=\"center\">RAW Size</th>
<th align=\"center\">Usable Size</th><th align=\"center\">Free Size</th></tr>"

In main {}
if free strB+=<data> else strA+=<data>

On END{}
and so on.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

2. UNIX for Dummies Questions & Answers

extract data from html tables

hi i need to use unix to extract data from several rows of a table coded in html. I know that rows within a table have the tags <tr> </tr> and so i thought that my first step should be to to delete all of the other html code which is not contained within these tags. i could then use this method... (8 Replies)
Discussion started by: Streetrcr
8 Replies

3. UNIX and Linux Applications

create 'day' tables based on timestamp in mysql

How would one go about creating 'day' tables based on the timestamp field. I have some 'import' tables which contains data from various days and would like to spilt that data up into 'days' based on the timestamp field in new tables. TABLE_IMPORT1 TABLE_IMPORT2 TABLE_IMPORT3 ... (2 Replies)
Discussion started by: hazno
2 Replies

4. Shell Programming and Scripting

Create a html file if a process is running??

Hi All, I need to check for a process, if the process is running then I have to create an HTML file, say A.HTML. If the process is not running then I have to rename the existing html, say A.HTML to B.HTML so that the process which looks for the file A.HTML does not find it? How do I do... (1 Reply)
Discussion started by: Hangman2
1 Replies

5. Shell Programming and Scripting

help with a bash script to create a html table

Hi guys as the title says i need a little help i have partisally written a bash script to create a table in html so if i use ./test 3,3 i get the following output for the third arguement in the script i wish to include content that will be replace the A characters in the... (2 Replies)
Discussion started by: dunryc
2 Replies

6. Programming

MySQL: Create a relation between two tables.

Hello everybody, I'm having troubles creating a relation between two tables in a MySQL database. Having two tables, being one which contains users information (username, password, user ID, etc) and the other the one which contains transactions information (operation type, user ID of the user who... (2 Replies)
Discussion started by: semash!
2 Replies

7. UNIX for Dummies Questions & Answers

Help me to create html document

Hi all, I have to find the count from File. tsv and need the output file format will be in html using shell script. Ex: File.tsv A B C D 1 2 3 4 5 6 7 4 9 10 11 12 output in html: FileName Count A 3 (1 Reply)
Discussion started by: Shenbaga.d
1 Replies

8. Shell Programming and Scripting

Splitting csv into 3 tables in html file

I have the data in csv in 3 tables. how can I output the same into 3 tables in html.also how can I set the width. tried multiple options . attached is the format. #!/bin/ksh awk 'BEGIN{ FS="," print "<HTML><BODY><TABLE border = '1' cellpadding=10 width=100>" print... (7 Replies)
Discussion started by: archana25
7 Replies

9. HP-UX

Unable to send attachment with html tables in UNIX shell script

Heyy, any help would be grateful.... LOOKING FOR THE WAYS TO SEND AN EMAIL WITH ATTACHMENT & HTML TABLES IN BODY THROUGH SHELL SCRIPT (LINUX)..NOT SURE, IF WE HAVE ANY INBUILT HTML TAG OR UNIX COMMAND TO SEND THE ATTACHMENTS. KINDLY HELP below is small script posted for our understanding..... (2 Replies)
Discussion started by: Harsha Vardhan
2 Replies

10. UNIX for Beginners Questions & Answers

Extract the tables from html

Hi I have a script which extracts the table from HTML and convert it into .csv. But the problem in the script is if we have 2 tables in HTMl . it takes only the first table. Please help me what changes i need to do in the script to make it read the complete HTML page. Script is as below: ... (10 Replies)
Discussion started by: deepti01
10 Replies
GLGETCOLORTABLEPARAMETER(3G)											      GLGETCOLORTABLEPARAMETER(3G)

NAME
glGetColorTableParameterfv, glGetColorTableParameteriv - get color lookup table parameters C SPECIFICATION
void glGetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) void glGetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) PARAMETERS
target The target color table. Must be GL_COLOR_TABLE, GL_POST_CONVOLUTION_COLOR_TABLE, GL_POST_COLOR_MATRIX_COLOR_TABLE, GL_PROXY_COLOR_TABLE, GL_PROXY_POST_CONVOLUTION_COLOR_TABLE, GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE. pname The symbolic name of a color lookup table parameter. Must be one of GL_COLOR_TABLE_BIAS, GL_COLOR_TABLE_SCALE, GL_COLOR_TABLE_FORMAT, GL_COLOR_TABLE_WIDTH, GL_COLOR_TABLE_RED_SIZE, GL_COLOR_TABLE_GREEN_SIZE, GL_COLOR_TABLE_BLUE_SIZE, GL_COLOR_TABLE_ALPHA_SIZE, GL_COLOR_TABLE_LUMINANCE_SIZE, or GL_COLOR_TABLE_INTENSITY_SIZE. params A pointer to an array where the values of the parameter will be stored. DESCRIPTION
Returns parameters specific to color table target. When pname is set to GL_COLOR_TABLE_SCALE or GL_COLOR_TABLE_BIAS, glGetColorTableParameter returns the color table scale or bias parameters for the table specified by target. For these queries, target must be set to GL_COLOR_TABLE, GL_POST_CONVOLUTION_COLOR_TABLE, or GL_POST_COLOR_MATRIX_COLOR_TABLE and params points to an array of four elements, which receive the scale or bias factors for red, green, blue, and alpha, in that order. glGetColorTableParameter can also be used to retrieve the and size parameters for a color table. For these queries, set target to either the color table target or the proxy color table target. The and size parameters are set by glColorTable. The following table lists the and size parameters that may be queried. For each symbolic constant listed below for pname, params must point to an array of the given length, and receive the values indicated. ------------------------------------------------------------------- Parameter N Meaning ------------------------------------------------------------------- GL_COLOR_TABLE_FORMAT 1 Internal (e.g. GL_RGBA) GL_COLOR_TABLE_WIDTH 1 Number of elements in table GL_COLOR_TABLE_RED_SIZE 1 Size of red component, in bits GL_COLOR_TABLE_GREEN_SIZE 1 Size of green component GL_COLOR_TABLE_BLUE_SIZE 1 Size of blue component GL_COLOR_TABLE_ALPHA_SIZE 1 Size of alpha component GL_COLOR_TABLE_LUMINANCE_SIZE 1 Size of luminance component GL_COLOR_TABLE_INTENSITY_SIZE 1 Size of intensity component ------------------------------------------------------------------- NOTES
glGetColorTableParameter is present only if GL_ARB_imaging is returned when glGetString is called with an argument of GL_EXTENSIONS. ERRORS
GL_INVALID_ENUM is generated if target or pname is not an acceptable value. GL_INVALID_OPERATION is generated if glGetColorTableParameter is executed between the execution of glBegin and the corresponding execution of glEnd. SEE ALSO
glColorTable(3G), glTexParameter(3G), glColorTableParameter(3G) GLGETCOLORTABLEPARAMETER(3G)
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy