Spliting file and save it with date...

"Michelle Konzack [email protected] [sed-users]" <[email protected]> Sat, 16 Sep 2017 11:40:54 +0300
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
Good day,

I have seleral 1000 records of wind/solar data which where inserted in a
HTML page manually and it looks like:

<TR class="table_energy_row">
    <TD class="energytable_num"     >1</TD>
    <TD class="energytable_date"    >2017-07-23 Sat</TD>
    <TD class="energytable_time"    >23:59</TD>
    <TD class="energytable_wh_solar">1387</TD>
    <TD class="energytable_wh_wind" >0</TD>
    <TD class="energytable_comment" >Absolutely no wind the last 18 hours.<BR>Solarcharger went into FLOAT, because the battery was full.</TD>
</TR>

So, I made a script and now my records look like

<?php
$date     = "2017-07-23";
$time     = "23:59";
$wh_solar = "1387";
$wh_wind  = "0";
$comment  = "Absolutely no wind the last 18 hours.<BR>Solarcharger went into FLOAT, because the battery was full.";
<?php
$date     = "2017-07-24";
$time     = "23:59";
$wh_solar = "1125";
$wh_wind  = "2";
$comment  = "Only very little wind.";

what I need is, to split the file from <?php to the line before the next
one and save it with the date as e.g. 2017-07-23.data

How can I do this mos easyly?

Thanks in avance
Michelle

-- 
Michelle Konzack        Miila ITSystems @ TDnet
GNU/Linux Developer     00372-54541400


[Non-text portions of this message have been removed]