Sponsored Content
Top Forums Shell Programming and Scripting help with a bash script to create a html table Post 302401497 by dunryc on Saturday 6th of March 2010 12:34:43 PM
Old 03-06-2010
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

Quote:
echo "<table>" > table.html


for ((rows=1; rows<=$1; rows++));
do
echo "<tr>" >> table.html


for ((columns=1; columns<=$2; columns++));
do
echo "<td>A</td>" >> table.html

done

echo "</tr>" >> table.html

done

echo "</table>" >> table.html
so if i use ./test 3,3

i get the following output


Quote:
A A A
A A A
A A A

for the third arguement in the script i wish to include content that will be replace the A characters in the table this will be in the form of a text file as below

Quote:
Apples
Oranges
Bananas
Pears
Kiwis
Plums
Peaches
Grapes
Melons
these would appear in table for as above can any one please give me a heads up as to how i can accomplish this ? Cheers guys
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[ORACLE] CREATE TABLE in bash

Hey, I want to create a table in bash, my db server is oracle. You can find my script below: I am very confused. I tried to run this script many times without any luck. Please help! (6 Replies)
Discussion started by: radek
6 Replies

2. Shell Programming and Scripting

shell script output in HTML or with table like results

Hello, Currently i have a ksh script which will disply the results in plain text format. I want to format the result in more readable format like Making bold headings and format with colors etc. Something like html or excel format and send that content as email. Please help me how i can do... (2 Replies)
Discussion started by: kotasateesh
2 Replies

3. Shell Programming and Scripting

Create DB table through shell script

Hi, Can anyone tell me that, How to create table in Oracle database through shell script(ksh). Table contains 3 fields, 1] Emp ID, String, primary key 2] Name, String 3] B Date, date. Thanks in advance. (6 Replies)
Discussion started by: Poonamol
6 Replies

4. Shell Programming and Scripting

How can we create a string table in bash shell ?

Hello, How can we write the pseudo code below using Bash shell scripting? table = ; i=0; do{ grep table h.txt; }while(i<3); or table = ; i=0; for(i=0;i<3;i++) grep table h.txt; (4 Replies)
Discussion started by: dbgork
4 Replies

5. UNIX for Dummies Questions & Answers

Bash script to insert data into an html table

hi, I need to create a bash shell script which picks up data from a text file and in the output file puts it into an html made table. I have to use sed and awk utilties to do this the input text file will contain data in the format: job name para1 para2 para3 para4 para4 1 ... (1 Reply)
Discussion started by: intern123
1 Replies

6. Shell Programming and Scripting

Bash shell script that inserts a text data file into an HTML table

hi , i need to create a bash shell script that insert a text data file into an html made table, this table output has to mailed.I am new to shell scripting and have a very minimum idea of shell scripting. please help. (9 Replies)
Discussion started by: intern123
9 Replies

7. 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

8. Shell Programming and Scripting

Create Script from table

I have a table ABC with 4 columns and below data Col1,Col2,Col3,Col4 prod,10,12,joba prod,10,11,jobb qa,10,12,jobc I want to create an output file like this Server:prod StartTime:10 EndTime:12 JobName:joba Server:prod StartTime:10 EndTime:11 JobName:jobb (3 Replies)
Discussion started by: traininfa
3 Replies

9. Shell Programming and Scripting

[Solved] Shell script output in HTML or with table like results and mail

Hello, Currently i have a script which will disply the results in plain text format. I want to format the result in more readable format like Making bold headings and format with colors etc. Something like html and send that content as email. Please help me how i can do that. I am using... (10 Replies)
Discussion started by: joy lobo
10 Replies

10. 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
TIDY_GET_HTML(3)							 1							  TIDY_GET_HTML(3)

tidy::html - Returns atidyNodeobject starting from the <html> tag of the tidy parse tree

       Object oriented style

SYNOPSIS
tidyNode tidy::html (void ) DESCRIPTION
Procedural style tidyNode tidy_get_html (tidy $object) Returns a tidyNode object starting from the <html> tag of the tidy parse tree. PARAMETERS
o $object - The Tidy object. RETURN VALUES
Returns the tidyNode object. EXAMPLES
Example #1 tidy_get_html(3) example <?php $html = ' <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html>'; $tidy = tidy_parse_string($html); $html = $tidy->html(); echo $html->value; ?> The above example will output: <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html> NOTES
Note This function is only available with Zend Engine 2 (PHP >= 5.0.0). SEE ALSO
tidy.body(3), tidy.head(3). PHP Documentation Group TIDY_GET_HTML(3)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy