Export HTML table


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 1 Week Ago
Export HTML table

HI ,

I have a HTML tables as below.
It has 2 tables ,I want to extract the second table .
Please help me in doing it.


Code:
<html>
<body>
<b><br>Running Date: </b>11-JAN-2019 03:07</br>
<h2> Schema mapping and info    </h2>
<BR><TABLE  width="100%" class="x1h" cellpadding="1" cellspacing="0" border="5">
<TR>
<b><td class="x3w" bgcolor="#808080" width="4%"> No </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Exp Schema e </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Export Tables </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Imp Schema </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Import Tables </TD>
<b><td class="x3w" bgcolor="#808080" width="5%"> Diff  </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#E3E4FA">1 </TD>
<b><td class="x3w" bgcolor="#E3E4FA">FVT4 </TD>
<b><td class="x3w" bgcolor="#E3E4FA">54 </TD>
<b><td class="x3w" bgcolor="#E3E4FA">PRDCUSTO </TD>
<b><td class="x3w" bgcolor="#E3E4FA">54 </TD>
<b><td class="x3w" bgcolor="#E3E4FA"> </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#E3E4FA">1 </TD>
<b><td class="x3w" bgcolor="#E3E4FA">FVT4 </TD>
<b><td class="x3w" bgcolor="#E3E4FA">56 </TD>
<b><td class="x3w" bgcolor="#E3E4FA">All Imp Schema</TD>
<b><td class="x3w" bgcolor="#E3E4FA">54 </TD>
<b><td class="x3w" bgcolor="#FF0000">2 </TD></TR>
</TABLE>
<h2> Missing Tables on ImpLogs   </h2>
<h3>       TABLE_NAME :NAME_DATA </h3>
<h3>       TABLE_NAME :WHITE_LIST_MIG </h3>
<h2> Table Rows Comparison   </h2>
<BR><TABLE  width="100%" class="x1h" cellpadding="1" cellspacing="0" border="5">
<TR>
<b><td class="x3w" bgcolor="#808080" width="4%"> No </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> TABLE NAME </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Exported Rows </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Imported Rows </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Diff Rows </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#E3E4FA">1 </TD>
<b><td class="x3w" bgcolor="#E3E4FA">NAME_DATA  </TD>
<b><td class="x3w" bgcolor="#E3E4FA">24760 </TD>
<b><td class="x3w" bgcolor="#E3E4FA"> </TD>
<b><td class="x3w" bgcolor="#FF0000">Not exist on Imp </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#E3E4FA">2 </TD>
<b><td class="x3w" bgcolor="#E3E4FA">WHITE_LIST_MIG  </TD>
<b><td class="x3w" bgcolor="#E3E4FA">12912 </TD>
<b><td class="x3w" bgcolor="#E3E4FA"> </TD>
<b><td class="x3w" bgcolor="#FF0000">Not exist on Imp </TD></TR>
</TABLE>
<h3> Imp and Exp logs Missmatch </h3>
<h2> All Exp , Imp logs Info   </h2>
<BR><TABLE  width="100%" class="x1h" cellpadding="1" cellspacing="0" border="5">
<TR>
<b><td class="x3w" bgcolor="#808080" width="4%"> No  </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> TABLE NAME </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Exported Rows </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Imported Rows </TD>
<b><td class="x3w" bgcolor="#808080" width="20%"> Diff Rows </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#BDD7EE">1 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">ADDRESS_DATA  </TD>
<b><td class="x3w" bgcolor="#BDD7EE">13753 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">13753 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#BDD7EE">2 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">ADDRESS_NAME_LINK  </TD>
<b><td class="x3w" bgcolor="#BDD7EE">68715 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">68715 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#BDD7EE">3 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">AGREEMENT  </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#BDD7EE">4 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">AGREEMENT_RESOURCE  </TD>
<b><td class="x3w" bgcolor="#BDD7EE">29979 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">29979 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD></TR>
<tr>
<b><td class="x3w" bgcolor="#BDD7EE">5 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">AGR_RES_HISTORY  </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD>
<b><td class="x3w" bgcolor="#BDD7EE">0 </TD></TR>

# 2  
Old 1 Week Ago
Well, if you have HTML like this, you have an obsolete style of HTML which is a decade old (or older).

Please write your HTML in HTML5 and not some obsolete HTML which web developers have not used for a very long time.
# 3  
Old 1 Week Ago
Try
Code:
awk '/<TABLE/ {CNT++; if (CNT == 2) P = 1}; P; /<\/TABLE/ {P = 0}' file

This User Gave Thanks to RudiC For This Post:
stomp (1 Week Ago)
# 4  
Old 1 Week Ago
This must be homework.

There is no way a real world HTML app would have and use this kind of "never used in 10 years" style of HTML.

Moderator's Comments:
Mod Comment Please do not reply to these types of obvious homework problems. Thread closed.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
How can i export entries from table into a variable and parse them? cookie2 UNIX for Advanced & Expert Users 4 12-14-2016 04:57 AM
Parsing - export html table data as .csv file? lxdorney Linux 7 05-20-2016 11:02 PM
How to export hive table data to a file on local UNIX? STCET22 Shell Programming and Scripting 1 05-28-2015 11:08 PM
Export table and restart from last table family_guy Shell Programming and Scripting 7 03-26-2014 12:53 PM
Help on filtering the table in HTML sidhi Web Development 2 03-13-2013 04:47 PM
Export table of 50 columns AAWT Shell Programming and Scripting 5 05-10-2012 09:24 AM
Shell script to export data from Oracle table . honey26 Shell Programming and Scripting 2 08-13-2011 08:36 PM
How to export table data to xml file? LinuxLearner Shell Programming and Scripting 2 06-24-2010 07:03 AM
Get HTML table valigula Shell Programming and Scripting 4 03-22-2010 12:43 PM
Export data from DB2 table to .txt file(space delimited) ss3944 Shell Programming and Scripting 2 12-17-2009 07:53 AM
Problem in scheduling an Export of a table beautifulmind Shell Programming and Scripting 6 08-25-2009 07:52 AM
Export a HTML table to Xcel garric Shell Programming and Scripting 3 02-01-2008 04:46 AM
HTML table to CSV i_priyank Shell Programming and Scripting 2 11-15-2007 10:29 AM
help for writing shell script to export table data sankarg Shell Programming and Scripting 3 10-18-2006 06:01 AM
export table from oracle database inquirer Shell Programming and Scripting 1 06-24-2003 09:48 AM