Dr. Arne JachensDr. Arne Jachens

php Library

readNamedData

Keine Erläuterungen gefunden.

<?php
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)){
      $n++;
      /* change format of numbers */
      $line=str_replace(",",".",$line);
      $values=explode($delimiter,$line);
      $time[$n]=trim($values[0]);
      for($m=0;$m<$NoVars;$m++){
	$data[$fieldNames[$m]][$n]=trim($values[$m]);
      } #m
      $line = fgets( $fid, 2048 );
    } #n
    fclose($fid);
  }else{
    printf("FILE ".$fname." DOES NOT EXIST!\N");
  }
  return $data;
}
?>

Index of Library

1globals.php
2readData.php
3XML_readFile.php
4fraktal.php
5fileGrep.php
6XML_extractTag.php
7writeNamedData.php
8readXmlFile.php
9readNamedData.php
10XML_findAllElements.php
11readFromStdIn.php
12plotResult.php
13dtaus.php
14pdf.php
15fitData.php
16XML_extractElement.php
17readFilenames.php
18writeData.php
19genDTAUS.php
20closeFigures.php
21XML_extractAttribute.php
22enumerateFiles.php
23db.php
24polynominalFit.php
25LaTeXbrief.php
26hex2dec.php

Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.