Or checkout the sql import facilities offered by your choice of database to 'convert' the data from log to db-tbl, then set up your analysis in PHP+SQL separately. =dn
----- Original Message ----- From: "Martin Wickman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 11 January 2002 09:08 Subject: [PHP] Re: Parsing SAR output with PHP. > Austin Gonyou wrote: > > > The real question I suppose is how could I parse this type > > of output into something I could use to make a graph. > > > > Example: > > 12:20:00 PM CPU %user %nice %system %idle > > 12:30:00 PM all 2.17 0.79 0.77 96.27 > > > > Problem is I'm not sure how to go about breaking up the rows > > to allow them to be inserted into the db. Thanks in advance for > > any ideas. > > I guess fields are separated with tabs? Then just use split, as in: > > > list($time,$cpu,$ser,$nice,$ststem, $idle)= split ("\t", $line); > > Then build your INSERT sql clause. Graph building is then a simple > matter of passing the data as arrays to your php graph system. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]