Link to home
Start Free TrialLog in
Avatar of navinbabu
navinbabuFlag for India

asked on

Preg match all pulling out a <table> from the code

Hello there

I m getting the code by using curl function I want to pull out the table that is from line number 72 to line number 327 in the code below I want the contents of the table from the second tr that is from line number 86 . Please assist me with the code on how to proceed with preg match all



<HTML>
<HEAD>
 
<Title>TRAIN NUMBERS</Title>
<HEAD>
<style type = "text/css">a:link{	color: blue; TEXT-DECORATION: none; }
a:visited{	color: rgb(0,153,153); } 
a:active {	color: rgb(255,102,0);}
p{	background-color: #E8E8D0; font-size: 20px;   FONT-FAMILY: arial,san-serif; FONT-SIZE: 10px; TEXT-DECORATION: none   color: #800000; }
body         { font-family: Verdana, Arial, Helvetica; background-color: FFFFFF;                color: #003366; font-size:10pt }
table        { table-border-color-light: rgb(00,153,153); table-border-color-dark:                rgb(00,153,153); background-color: #FFFFFF; font-size: 12px;                font-family: arial, san-serif; text-decoration:                none table-align Center; color: #800000;  }
h1, h2, h3, h4, h5, h6 { font-family:  Arial, Helvetica }
h1           
{ color: #800000; text-align: center; font-family: Arial; background-color:#FFFFFF;               font-size: 13pt; letter-spacing: 1pt; font-weight:                bold }
h2{	color: rgb(100,10,200); 	font-weight:bold;}
h3{	color: orange); }
h4           
{ font-family: arial, san-serif; text-decoration: none color #0066CC; color:                #FFFFFF; background-color: #003399; font-size: 10px }
h5           
{ color: #000066; font-size: 85%; text-align: Center; font-family: Arial }
h6           
{ color: #800080; font-family: Times New Roman; font-size: 10px;                letter-spacing: 1pt; text-align: Right; background-color:                #E8E8D0; font-style: italic; font-weight: bold }
.LegText     
{ color: #800000; font-family: arial, san-serif; font-size: 12px;                text-decoration: none; background-color: #FFFFFF }              
th           
{ background-color:#009999 ; font-size: 12px; font-family: arial, san-serif;                text-decoration: none; color: #FFFFFF }}
{ background-color:#009999 ; font-size: 12px; font-family: arial, san-serif;                text-decoration: none; color: #FFFFFF }}
 
</style>
</HEAD>
<BR>
 <BODY><table border="0" cellPadding="0" cellSpacing="0" width="95%"><tr>      <td align="center">         </td></tr></table>
 
<TABLE BORDER ALIGN=center >
<TR>
</TR>
</TABLE>
<TABLE border="0">
<td valign="top">
<H1 ALIGN = Center> TRAIN ROUTE </H1>
<TABLE BORDER ALIGN=center >
 <CAPTION> You Queried For </CAPTION>
<TR>
<TH>Train No</TH>
 
<TH>Train Name</TH>
<TH>Date</TH>
<TH>Runs From Source</TH>
<TH COLSPAN=7>Runs On</TH>
</TR>
<TR>
<TD>2727 </TD>
<TD>GODAVARI EXP   </TD>
<TD ALIGN = center>10/05/2009</TD>
<TD ALIGN = center>VISHAKAPATNAM  </TD>
 
<TD>MON </TD>
<TD>TUE </TD>
<TD>WED </TD>
<TD>THU </TD>
<TD>FRI </TD>
<TD>SAT </TD>
<TD>SUN </TD></TR>
</TABLE>
</td>
<td style="background-color: #FFFFFF" width="391" valign="top" rowspan="2">
 
<div id="narrow_ads_bottom"></div>
</td>
<tr>
<td valign="top">
<TABLE BORDER ALIGN=center>
<TR>
<TH>SNo</TH>
<TH>Stn Code</TH>
<TH>Stn Name</TH>
<TH>Route No.</TH>
<TH>Arrival Time</TH>
<TH>Dep. Time</TH>
 
<TH>Distance</TH>
<TH>Day</TH>
<TH>Remark</TH>
</TR>
<TR>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>VSKP</TD>
<TD>VISHAKAPATNAM  </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center><FONT COLOR = red>Source</TD>
 
<TD ALIGN = Center>17:25</TD>
<TD ALIGN = Center>0</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>2</TD>
<TD ALIGN = Center>DVD </TD>
<TD>DUVVADA        </TD>
<TD ALIGN = Center>1</TD>
 
<TD ALIGN = Center>17:53</TD>
<TD ALIGN = Center>17:54</TD>
<TD ALIGN = Center>18</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>3</TD>
<TD ALIGN = Center>AKP </TD>
<TD>ANAKAPALLE     </TD>
 
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>18:08</TD>
<TD ALIGN = Center>18:09</TD>
<TD ALIGN = Center>34</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>4</TD>
<TD ALIGN = Center>YLM </TD>
 
<TD>ELLAMANCHILI   </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>18:28</TD>
<TD ALIGN = Center>18:29</TD>
<TD ALIGN = Center>57</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>5</TD>
 
<TD ALIGN = Center>NRP </TD>
<TD>NARSIPATNAM RD </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>18:43</TD>
<TD ALIGN = Center>18:44</TD>
<TD ALIGN = Center>75</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
 
<TR>
<TD ALIGN = Center>6</TD>
<TD ALIGN = Center>TUNI</TD>
<TD>TUNI           </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>18:59</TD>
<TD ALIGN = Center>19:00</TD>
<TD ALIGN = Center>97</TD>
<TD ALIGN = Center>1</TD>
 
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>7</TD>
<TD ALIGN = Center>ANV </TD>
<TD>ANNAVARAM      </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>19:13</TD>
<TD ALIGN = Center>19:14</TD>
<TD ALIGN = Center>114</TD>
 
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>8</TD>
<TD ALIGN = Center>PAP </TD>
<TD>PITHAPURAM     </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>19:31</TD>
<TD ALIGN = Center>19:32</TD>
 
<TD ALIGN = Center>139</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>9</TD>
<TD ALIGN = Center>SLO </TD>
<TD>SAMALKOT JN    </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>19:44</TD>
 
<TD ALIGN = Center>19:45</TD>
<TD ALIGN = Center>151</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>10</TD>
<TD ALIGN = Center>APT </TD>
<TD>ANAPARTI       </TD>
<TD ALIGN = Center>1</TD>
 
<TD ALIGN = Center>20:04</TD>
<TD ALIGN = Center>20:05</TD>
<TD ALIGN = Center>177</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>11</TD>
<TD ALIGN = Center>RJY </TD>
<TD>RAJAMUNDRY     </TD>
 
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>20:41</TD>
<TD ALIGN = Center>20:45</TD>
<TD ALIGN = Center>201</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>12</TD>
<TD ALIGN = Center>NDD </TD>
 
<TD>NIDADAVOLU JN  </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>21:09</TD>
<TD ALIGN = Center>21:10</TD>
<TD ALIGN = Center>223</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>13</TD>
 
<TD ALIGN = Center>TDD </TD>
<TD>TADEPALLIGUDEM </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>21:27</TD>
<TD ALIGN = Center>21:28</TD>
<TD ALIGN = Center>243</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
 
<TR>
<TD ALIGN = Center>14</TD>
<TD ALIGN = Center>EE  </TD>
<TD>ELURU          </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>22:01</TD>
<TD ALIGN = Center>22:02</TD>
<TD ALIGN = Center>291</TD>
<TD ALIGN = Center>1</TD>
 
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>15</TD>
<TD ALIGN = Center>BZA </TD>
<TD>VIJAYAWADA JN  </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>23:40</TD>
<TD ALIGN = Center>23:55</TD>
<TD ALIGN = Center>350</TD>
 
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>16</TD>
<TD ALIGN = Center>KMT </TD>
<TD>KHAMMAM        </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>01:13</TD>
<TD ALIGN = Center>01:15</TD>
 
<TD ALIGN = Center>452</TD>
<TD ALIGN = Center>2</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>17</TD>
<TD ALIGN = Center>WL  </TD>
<TD>WARANGAL       </TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>02:46</TD>
 
<TD ALIGN = Center>02:48</TD>
<TD ALIGN = Center>559</TD>
<TD ALIGN = Center>2</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>18</TD>
<TD ALIGN = Center>KZJ </TD>
<TD>KAZIPET JN     </TD>
<TD ALIGN = Center>1</TD>
 
<TD ALIGN = Center>03:05</TD>
<TD ALIGN = Center>03:07</TD>
<TD ALIGN = Center>569</TD>
<TD ALIGN = Center>2</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>19</TD>
<TD ALIGN = Center>SC  </TD>
<TD>SECUNDERABAD JN</TD>
 
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>05:45</TD>
<TD ALIGN = Center>05:50</TD>
<TD ALIGN = Center>701</TD>
<TD ALIGN = Center>2</TD>
<TD ALIGN = Center>                </TD>
</TR>
<TR>
<TD ALIGN = Center>20</TD>
<TD ALIGN = Center>HYB </TD>
 
<TD>HYDERABAD DECAN</TD>
<TD ALIGN = Center>1</TD>
<TD ALIGN = Center>06:15</TD>
<TD ALIGN = Center><FONT COLOR = red>Destination</TD>
<TD ALIGN = Center>710</TD>
<TD ALIGN = Center>2</TD>
<TD ALIGN = Center>                </TD>
</TR>
</TABLE>
</td>
 
</tr>
</table>
 
</BODY>
</HTML>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial