Sponsored Content
Top Forums Shell Programming and Scripting Converting html table data into multiple variables. Post 302399643 by domsmith on Monday 1st of March 2010 06:09:58 AM
Old 03-01-2010
Sorry about that

Attached is what I have cut from the html page

Code:
Monday
March 1 2010

<table width='100%' border='1' cellspacing='0' cellpadding='3'>        

<tr>
            
<th>Booking #</th>
<th>Client / UOS</th>
<th>Day</th>
<th>Times</th>
<th>Dates</th>
<th>Frequency</th>
<th>Capacity</th>
<th>Purpose</th>
<th>&nbsp;</th>
</tr>
                        
<tr>
<td>
                                        
<a href='bookingDetails.jsp?tempViewSingle=true&bookingId=595897'>595897</a>
</td>
                                    
                                        
<td><a href="https://www.unix.com/ttLabel.jsp?academicYear=2010&sessionId=1&labelString=LAWS1022&campusId=1">LAWS1022</a></td>
                                        
<td>MON</td>
<td>10:00 - 12:00</td>
<td>1 Mar 10 - 12 Apr 10</td>
<td>Weekly</td>
<td>20</td>
<td>Seminar</td>
                    
<td>
<a href='booking.jsp?level2=Edit&bookingId=595897'>Edit</a>
                        
&nbsp;</td>
                    
</tr>
                        
<tr>
<td>
<a href='bookingDetails.jsp?tempViewSingle=true&bookingId=595914'>595914</a>
</td>
                                        
                                        
<td><a href="https://www.unix.com/ttLabel.jsp?academicYear=2010&sessionId=1&labelString=LAWS1013&campusId=1">LAWS1013</a></td>
                                        
<td>MON</td>
<td>12:00 - 13:00</td>
<td>1 Mar 10 - 12 Apr 10</td>
<td>Weekly</td>                    
<td>20</td>
<td>Seminar</td>
<td>
                        
<a href='booking.jsp?level2=Edit&bookingId=595914'>Edit</a>
&nbsp;</td>
                    
</tr>
                        
<tr>
<td>
                                        
<a href='bookingDetails.jsp?tempViewSingle=true&bookingId=595900'>595900</a>
</td>
                                        
<td><a href="https://www.unix.com/ttLabel.jsp?academicYear=2010&sessionId=1&labelString=LAWS1022&campusId=1">LAWS1022</a></td>
                                        
<td>MON</td>
<td>14:00 - 16:00</td>
<td>1 Mar 10 - 12 Apr 10</td>
<td>Weekly</td>                    
<td>20</td>
<td>Seminar</td>
<td>
<a href='booking.jsp?level2=Edit&bookingId=595900'>Edit</a>
&nbsp;</td>
                    
</tr>
                        
</table>
<p>

Tuesday
March 2 2010

Basically each value between
Code:
<th> value </th><td> value </td>

is what I want to capture but sometimes the capacity column, frequency column or both columns are not always generated. So both the number of columns or number of rows can differ from day to day.

Last edited by domsmith; 03-01-2010 at 09:34 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting HTML data into a spreadsheet

Hi, I have a perl script that prints some data in the form of a table (HTML table) Now, I want to be able to convert this data into a report on an Excel sheet. How can I do this? Regards, Garric (4 Replies)
Discussion started by: garric
4 Replies

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

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

4. Shell Programming and Scripting

extract complex data from html table rows

I have bash, awk, and sed available on my portable device. I need to extract 10 fields from each table row from a web page that looks like this: </tr> <tr> <td>28 Apr</td> <td><a... (6 Replies)
Discussion started by: rickgtx
6 Replies

5. UNIX for Advanced & Expert Users

Mutt for html body and multiple html & pdf attachments

Hi all: Been racking my brain on this for the last couple of days and what has been most frustrating is that this is the last piece I need to complete a project. There are numerous posts discussing mutt in this forum and others but I have been unable to find similar issues. Running with... (1 Reply)
Discussion started by: raggmopp
1 Replies

6. Shell Programming and Scripting

awk -- Extract data from html within multiple tags as reference

Hi, I'm trying to get some data from an html file, but the problem is before it can extract the information I have multiple patterns that need to be passed through. https://www.unix.com/shell-programming-scripting/150711-extract-data-awk-html-files.html Is a similar problem. The only... (5 Replies)
Discussion started by: counfhou
5 Replies

7. Shell Programming and Scripting

Creating html table from data in file

Hi. I need to create html table from file which contains data. No awk please :) In example, ->cat file num1 num2 num3 23 3 5 2 3 4 (between numbers and words single TAB). after running mycode i need to get (heading is the first line): <table>... (2 Replies)
Discussion started by: Manu1234567
2 Replies

8. Shell Programming and Scripting

Input data of a file from perl into HTML table

Hi , I need an help in perl scripting. I have an perl script written and i have an for loop in that ,where as it writes some data to a file and it has details like below. cat out.txt This is the first line this is the second line. .....Now, this file needs to be send in mail in HTML... (2 Replies)
Discussion started by: scott_cog
2 Replies

9. Linux

Parsing - export html table data as .csv file?

Hi all, Is there any out there have a brilliant idea on how to export html table data as .csv or write to txt file with separated comma and also get the filename of link from every table and put one line per rows each table. Please see the attached html and PNG of what it looks like. ... (7 Replies)
Discussion started by: lxdorney
7 Replies

10. UNIX for Beginners Questions & Answers

Generate files and use csv data to replace multiple variables in a template

I have a source csv file consists of first field as variable name, and the rest are site-specific information (converted from excel file, where site -specific values in columns). I am trying to create a file for every site using a template and replace the multiple variables with values from the... (3 Replies)
Discussion started by: apalex
3 Replies
COLORS(3)						   libbash colors Library Manual						 COLORS(3)

NAME
colors -- libbash library for setting tty colors. SYNOPSIS
colorSet <color> colorReset colorPrint [<indent>] <color> <text> colorPrintN [<indent>] <color> <text> DESCRIPTION
General colors is a collection of functions that make it very easy to put colored text on tty. The function list: colorSet Sets the color of the prints to the tty to COLOR colorReset Resets current tty color back to normal colorPrint Prints TEXT in the color COLOR indented by INDENT (without adding a newline) colorPrintN The same as colorPrint, but trailing newline is added Detailed interface description follows. Available colors: Green Red Yellow White The color parameter is non-case-sensitive (i.e. RED, red, ReD, and all the other forms are valid and are the same as Red). FUNCTIONS DESCRIPTIONS
colorSet <color> Sets the current printing color to color. colorReset Resets current tty color back to normal. colorPrint [<indent>] <color> Prints text using the color color indented by indent (without adding a newline). Parameters: <indent> The column to move to before start printing. This parameter is optional. If ommitted - start output from current cursor position. <color> The color to use. <color> The text to print. colorPrintN [<indent>] <color> The same as colorPrint, except a trailing newline is added. EXAMPLES
Printing a green 'Hello World' with a newline: Using colorSet: $ colorSet green $ echo 'Hello World' $ colorReset Using colorPrint: $ colorPrint 'Hello World'; echo Using colorPrintN: $ colorPrintN 'Hello World' AUTHORS
Hai Zaar <haizaar@haizaar.com> Gil Ran <gil@ran4.net> SEE ALSO
ldbash(1), libbash(1) Linux Epoch Linux
All times are GMT -4. The time now is 01:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy