test.txt file:
Ext Temperatur: 210.0°
Avg.Speed(All): 62.89mm/s
Avg.Speed(Print): 49.99mm/s
Avg.Speed(Travel): 199.84mm/s
Overall Time (w/o Acceleration): 11:00:41 (39640.65sec)
How can I grab 39640.65sec and 39640.65 as outputs using grep and print with php code?
I am using this code but it prints e.g.: 11:00:41 (39640.65sec)
<?php
$gcode_new = "grep -Po '(?<=Overall Time \(w/o Acceleration\): ).*' test.txt";
include('Net/SSH2.php');
$ssh = new Net_SSH2('XXX.61.XXX.227');
if (!$ssh->login('root', 'PASS')) {
exit('Login Failed');
}
$target = $ssh->exec($gcode_new);
echo $target ;
?>