BASH / PHP从多列日志中获取最小值/最大值

Okay, I have now another question, hopefully the last one. I collect the temperature with some sensors with a rasperry pi. A bash-script writes the logfile whatever_$day.log during the day. It looks like that (date, time, sensor1, sensor2, sensor3):

2017-03-16  08:15  27.3  25.4  16.8
2017-03-16  08:30  22.2  23.1  14.2
2017-03-16  08:45  24.1  24.3  14.6
2017-03-16  09:00  26.8  23.0  14.7

Meanwhile I know, how to get the min, max and average values with PHP (thanks!) - but this only works with a simple logfile with one colum (only one temperature):

$temperatures = file($file, FILE_IGNORE_NEW_LINES);
$min = min($temperatures);
$max = max($temperatures);
$average = array_sum($temperatures) / count($temperatures);

but I want to avoid to create dozens of log-files or make requests for every sensor and every max/min/av value, I just want one log-file for the one day and read/create the max/min/average value at the end of the day with a Bash or PHP-script and save the values into another log-file (monthly log like [eg.: $day $min $max $average [append to >>] $month_sensor1.log]. I use this values to create diagrams/graphs with PHPlot.

But I don't understand, how to read the logfile by columns like [read whatever_$day.log and collect the second temperatur-value ~ $temperature[2] column and create the max / min / average values and save them into $maximum / $minimum / $average] and so one. I read some other submits here with sort and so on, but to be honest, I'm completely lost, this is too big for my small non-programmer-brain. /o\

Any ideas? Thanks in advanced and sorry for my low-level english!

Your file format is not ideal for the automatic processing. It's better to use a ',' or ';' as delimiter. Then you can use the split function in php to split one line in an array you can work with. You can use the current format if you have always two blanks between the values, but it makes things harder to debug if anything goes wrong.