Download Documentation - Nickalls.org

Transcript
CHAPTER 20. FIELDS2PDATA.PL
RWD Nickalls

$gmt = localtime();
print (printlog "printlog.txt, ",$gmt,"\n");
print (printlog "log of the printing module [fields2PDATA.pl]\n");
print (printlog "...this program is CALLed by < processdata.pl >\n");
print (printlog "----------start of [perl fields2PDATA.pl]-----------\n");
##===============determine the UNIXstarttime from binlog files=========================
## make an array of all required input filenames
## we are running this from the /PDATA/ dir
@fieldfilename = (
"../fields/bp-d.binlog",
"../fields/bp-s.binlog",
"../fields/ecg-rr.binlog",
"../fields/co2-exp.binlog",
"../fields/co2-insp.binlog",
"../fields/co2-rr.binlog",
"../fields/cvp.binlog",
"../fields/ecg-hr.binlog",
"../fields/ecg-rr.binlog",
"../fields/mac-big.binlog",
"../fields/mac-n2o.binlog",
"../fields/mac-vap.binlog",
"../fields/mv-exp.binlog",
"../fields/n2o-exp.binlog",
"../fields/nibp-d.binlog",
"../fields/nibp-s.binlog",
"../fields/o2-insp.binlog",
"../fields/pplat.binlog",
"../fields/sat.binlog",
"../fields/sat-hr.binlog",
"../fields/temp[0].binlog",
"../fields/temp[1].binlog",
"../fields/tv-exp.binlog",
"../fields/tv-insp.binlog",
"../fields/vap-code.binlog",
"../fields/vap-exp.binlog",
"../fields/vap-insp.binlog"
);
#get each .binlog file in turn, and read the first line for UNIXtime
for ($j=0; $j<=$#fieldfilename; $j=$j+1 )
{
$ifile = $fieldfilename[$j];
if (-e $ifile) {
open (fieldsfile, "<$ifile")||die "ERROR: can’t open file $ifile\n";
}
else {print (printlog $ifile, " does NOT exist\n");
next}