This commit is contained in:
Timothy Allen 2017-12-19 01:09:11 +02:00
parent fddd1c6b84
commit 0241354dc1

View File

@ -40,6 +40,7 @@ my $output = '';
my $max_glucose = 8;
my $min_glucose = 4;
my $graph_max = 21;
my $noicons = 0;
my $units = '';
my $page = 'a4';
my $graphs_per_page = 2;
@ -50,7 +51,8 @@ GetOptions ("input=s" => \$input, # The name of the CSV file from wh
"max:i" => \$graph_max, # The highest displayed glucose level on each graph
"units:s" => \$units, # mmol/L or mg/dL
"pagesize:s" => \$page, # size of page to print
"graphs:i" => \$graphs_per_page) # The number of days printed on each page
"noicons" => \$noicons, # include icons (yes or no)
"graphs:i" => \$graphs_per_page)# The number of days printed on each page
or die $error;
@ -106,6 +108,10 @@ while ( my $row = <$ifh> ) {
# Parse CSV into whitespace-separated tokens to avoid conflicting separators
$row =~ s#^"(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})","([\d\.]+)",.*,"(.*?)"$#$1T$2 $3 "$4"#;
# Remove icons if not requested
$row =~ s# "[^"]+"## if ( $noicons );
push @filelines, $row;
}
@ -681,5 +687,4 @@ close( $ofh )
#print GNUPLOT $gnuplot_data;
#close(GNUPLOT);
# vim : set expandtab shiftwidth=4 softtabstop=4 tw=1000 :
# vim: set expandtab shiftwidth=4 softtabstop=4 tw=1000 :