#!/usr/local/bin/perl -w # camitro5.p # combine output files and output csv $pfile = "o/o1p" ; $tefile = "master-for-dave-test-258.csv" ; # Default settings $verbose= 0 ; $sep=","; $strip="36 79 81 113 116 127 192 220" ; eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; if ( 1 ) { $_ = $strip ; @s = split ; $ss = ":".join(":",@s).":" ; print STDERR "read row suspects (number $#s)- $ss\n" ; } else { $ss = "" ; } # Read and write $line = 0 ; open(TE,"<$tefile") || die("no $tefile"); open(P, "<$pfile") || die("no $pfile"); $banner = ; @w=split(",", $banner) ; $newbanner="$w[0],$w[1]-pred,$w[2]-pred,$w[1]-lower,$w[2]-lower,$w[1]-upper,$w[2]-upper,UNCERTAIN-indicator"; print $newbanner."\n" ; while ( ( $_ = ) && ( $pr =

) ) { # print "read in $_ and $pr\n" ; $line ++ ; s/^\s*//; # get rid of initial gap on line s/\n//; # get rid of newline if("0" eq $sep) { @w=split ; # use default space separator }else{ @w=split($sep, $_) ; } $_ = $pr ; s/^\s*//; # get rid of initial gap on line s/\n//; # get rid of newline @pred = split ; if( $ss =~ /:$line:/ ) { # MARK this row as dodgy $indi = "UNCERTAIN" ; } else { $indi = "0" ; } printf "%s,%s,%8.5g,%s,%8.5g,%s,%8.5g,%s\n" , $w[0],$pred[0],log($pred[0])/log(10.0),$pred[2],log($pred[2])/log(10.0),$pred[3],log($pred[3])/log(10.0),$indi; if ( $#w == -1 ) { # $blank ++ ; print STDERR "warning, blank line\n" ; } } #