Page 1 of 1
import raw log file into the website in table format
Posted: Sun 14 Nov 2010 11:25 am
by sunray24
Just wondering if there was an easy way to import the raw log files into the website?
So that I can display the historical data in table format
For example - much the same way that weather underground shows it for user weather stations (scroll to bottom of page)
example
http://www.wunderground.com/weatherstat ... =IWADARLI2
Scott
Re: import raw log file into the website in table format
Posted: Sun 14 Nov 2010 11:38 am
by daj
Scott
This may be a good place to start the reading....
https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=2367
I'm sure there was chat of a solution only using the TXT file but i can't find the post
There are a number of things to think of....
Getting the data onto the web server regularly
How to store on the server (text file, database)
How to present to the user
Re: import raw log file into the website in table format
Posted: Sun 14 Nov 2010 12:42 pm
by sunray24
Thanks David for your reply
Will read up on it
Scott
Re: import raw log file into the website in table format
Posted: Sun 14 Nov 2010 2:09 pm
by nitrx
Re: import raw log file into the website in table format
Posted: Sun 14 Nov 2010 7:15 pm
by DaveNZ
If I have understood you correctly, you want to display the file such as Oct10log.txt in table format.
I have done something similar recently.
EDIT sorry just saw David's post and link to the other thread, d'oh!!
still I will leave my rough outline below
Code: Select all
some html...
<table>
<tr>
insert table headings...
<tr>
<?php
$f="Oct10log.txt";
$logfile=fopen($f,"r");
while (!feof($logfile)) {
$data=fgets($logfile);
$dataA=explode(",",$data);
echo "<tr>";
for ($i=0;$i<count($dataA);$i++) {
echo "<td>$dataA[$i]</td>";
}
echo "</tr>";
}
fclose($logfile);
?>
</table>
....rest of html
Re: import raw log file into the website in table format
Posted: Mon 15 Nov 2010 12:30 am
by beteljuice
The beteljuice started (but yet again did not complete) playing with the 'flat' file / php combination.
Work never finished here in rough form (so I could see what was happening as I coded)
http://www.beteljuice.com/dayfile/take3.php
As a lot of people seem to have mysql etc, plus some have come up some excellent graphing options, plus now there is even more data to consider ....... it sits quietly in my webspace (sorry nitrx).
As you will see, it determines the wx units AND PC delimiters and delivers any calculated results in the same format.