Heating and Ventilation Control
/readNamedData
Keine Erläuterungen gefunden.
<?php /* published under GPL www.gnu.org/licenses/gpl.html */ function readNamedData($fname,$path,$delimiter){ $fname=sprintf("%s%s", $path, $fname); if (file_exists($fname)) { $fid = fopen($fname, "r"); $line = fgets( $fid, 2048 ); #headerline $line=str_replace(" #","",trim($line)); $fieldNames=explode($delimiter,$line); $NoVars=count($fieldNames); $line = fgets( $fid, 2048 ); $n=-1; while(!feof($fid)){ if($line[0]!=" #"){ $n++; /* change format of numbers */ $line=str_replace(",",".",$line); $values=explode($delimiter,$line); #echo $fname. "<br>"; #print_r($fieldNames);echo "<br>"; #print_r($values);echo"<br>"; #exit(1); $time[$n]=trim($values[0]); echo $line. "<br>"; for($m=0;$m<$NoVars;$m++){ $data[$fieldNames[$m]][$n]=trim($values[$m]); } #m } #fi $line = fgets( $fid, 2048 ); } #n fclose($fid); }else{ printf("FILE ".$fname." DOES NOT EXIST!\N"); } return $data; } ?>
python
php
Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.