Mam pewien projekt ale nie wiem czy się w to w ogóle bawić, mianowicie.
Mam plik html w który sa zapisane dane odnośnie urzadzenia, dane sa przedstawione w formie tabel ale nie maja konkretnie nazwanych pól
Kod
[html]<table bgcolor="#eeeeee" border="0" cellspacing="0" cellpadding="2" width="100%">
<tbody><tr>
<td align="center" colspan="6">
<h1>Current Substrate, Printhead and Ink Information (1 of 2)</h1>
</td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Date:</td><td valign="top" style="white-space:nowrap;" align="right">2014-10-07 10:21:28 </td><td valign="top" style="white-space:nowrap;" align="left"> Product:</td><td valign="top" style="white-space:nowrap;" align="right">HP Latex 360 Printer </td><td valign="top" style="white-space:nowrap;" align="left"> Serial Number:</td><td valign="top" style="white-space:nowrap;" align="right">MY43K1901N </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Firmware:</td><td valign="top" style="white-space:nowrap;" align="right">NEXUS_00_03_09.1 </td><td valign="top" style="white-space:nowrap;" align="left"> Product number:</td><td valign="top" style="white-space:nowrap;" align="right">B4H70A </td><td valign="top" style="white-space:nowrap;" align="left"> Service ID:</td><td valign="top" style="white-space:nowrap;" align="right">24086 </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Supported Ink Cartridges:</td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right">HP 831 / HP 831C </td><td valign="top" style="white-space:nowrap;" align="right"> </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Printer status:</td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right">Ready Temp. OK to open window </td><td valign="top" style="white-space:nowrap;" align="right"> </td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="6">
</td>
</tr>
</tbody></table>
<table bgcolor="#eeeeee" border="0" cellspacing="0" cellpadding="2" width="100%">
<tbody><tr>
<td style="background-color:#716B66;font-weight:bold;color:#ffffff;" align="center" colspan="4">Current Printer Configuration</td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Language:</td><td valign="top" style="white-space:nowrap;" align="right">English </td><td valign="top" style="white-space:nowrap;" align="left"> Memory:</td><td valign="top" style="white-space:nowrap;" align="right">992 MB </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Disk capacity:</td><td valign="top" style="white-space:nowrap;" align="right">16.0 GB </td><td valign="top" style="white-space:nowrap;" align="left"> Hard Disk model:</td><td valign="top" style="white-space:nowrap;" align="right"> SanDisk SDSA5GK-016G-1006 </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Current Temperature:</td><td valign="top" style="white-space:nowrap;" align="right">29.3°C ±2°C </td><td valign="top" style="white-space:nowrap;" align="left"> Current Humidity:</td><td valign="top" style="white-space:nowrap;" align="right">41% ±15% </td>
</tr>
<tr>
<td style="background-color:#716B66;font-weight:bold;color:#ffffff;" align="center" colspan="4">Substrate Loaded Information</td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Substrate Path:</td><td valign="top" style="white-space:nowrap;" align="right">Roll </td><td valign="top" style="white-space:nowrap;" align="left"> Substrate Loaded Status:</td><td valign="top" style="white-space:nowrap;" align="right">OK </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Substrate Type:</td><td valign="top" style="white-space:nowrap;" align="right">APEX PAPIER LATEXOWY 211g </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Substrate Width:</td><td valign="top" style="white-space:nowrap;" align="right">1372 mm / 54.0 inches </td><td valign="top" style="white-space:nowrap;" align="left"> Substrate Length:</td><td valign="top" style="white-space:nowrap;" align="right">not available </td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="4">
</td>
</tr>
</tbody></table>[/html]
<tbody><tr>
<td align="center" colspan="6">
<h1>Current Substrate, Printhead and Ink Information (1 of 2)</h1>
</td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Date:</td><td valign="top" style="white-space:nowrap;" align="right">2014-10-07 10:21:28 </td><td valign="top" style="white-space:nowrap;" align="left"> Product:</td><td valign="top" style="white-space:nowrap;" align="right">HP Latex 360 Printer </td><td valign="top" style="white-space:nowrap;" align="left"> Serial Number:</td><td valign="top" style="white-space:nowrap;" align="right">MY43K1901N </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Firmware:</td><td valign="top" style="white-space:nowrap;" align="right">NEXUS_00_03_09.1 </td><td valign="top" style="white-space:nowrap;" align="left"> Product number:</td><td valign="top" style="white-space:nowrap;" align="right">B4H70A </td><td valign="top" style="white-space:nowrap;" align="left"> Service ID:</td><td valign="top" style="white-space:nowrap;" align="right">24086 </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Supported Ink Cartridges:</td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right">HP 831 / HP 831C </td><td valign="top" style="white-space:nowrap;" align="right"> </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Printer status:</td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right">Ready Temp. OK to open window </td><td valign="top" style="white-space:nowrap;" align="right"> </td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="6">
</td>
</tr>
</tbody></table>
<table bgcolor="#eeeeee" border="0" cellspacing="0" cellpadding="2" width="100%">
<tbody><tr>
<td style="background-color:#716B66;font-weight:bold;color:#ffffff;" align="center" colspan="4">Current Printer Configuration</td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Language:</td><td valign="top" style="white-space:nowrap;" align="right">English </td><td valign="top" style="white-space:nowrap;" align="left"> Memory:</td><td valign="top" style="white-space:nowrap;" align="right">992 MB </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Disk capacity:</td><td valign="top" style="white-space:nowrap;" align="right">16.0 GB </td><td valign="top" style="white-space:nowrap;" align="left"> Hard Disk model:</td><td valign="top" style="white-space:nowrap;" align="right"> SanDisk SDSA5GK-016G-1006 </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Current Temperature:</td><td valign="top" style="white-space:nowrap;" align="right">29.3°C ±2°C </td><td valign="top" style="white-space:nowrap;" align="left"> Current Humidity:</td><td valign="top" style="white-space:nowrap;" align="right">41% ±15% </td>
</tr>
<tr>
<td style="background-color:#716B66;font-weight:bold;color:#ffffff;" align="center" colspan="4">Substrate Loaded Information</td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Substrate Path:</td><td valign="top" style="white-space:nowrap;" align="right">Roll </td><td valign="top" style="white-space:nowrap;" align="left"> Substrate Loaded Status:</td><td valign="top" style="white-space:nowrap;" align="right">OK </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Substrate Type:</td><td valign="top" style="white-space:nowrap;" align="right">APEX PAPIER LATEXOWY 211g </td><td valign="top" style="white-space:nowrap;" align="right"> </td><td valign="top" style="white-space:nowrap;" align="right"> </td>
</tr>
<tr>
<td valign="top" style="white-space:nowrap;" align="left"> Substrate Width:</td><td valign="top" style="white-space:nowrap;" align="right">1372 mm / 54.0 inches </td><td valign="top" style="white-space:nowrap;" align="left"> Substrate Length:</td><td valign="top" style="white-space:nowrap;" align="right">not available </td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="4">
</td>
</tr>
</tbody></table>[/html]
To tylko fragment pliku ale cały jest w ten sposób zbudowany, i teraz pytanie jak łatwo i przyjemnie jesli się tak da oczywiście wyciagnać z niego interesujace mnie dane z umieszczeniem ich w bazie to juz zaden problem tylko jak szybko te dane z 300Kb pliku wyciagnać. Myslałem aby zrobić z tego tablice i z konkretnych wierszy wyfiltrowac html od tekstu ale moze macie jakieś lepszy sposób.