Cleanup.
This commit is contained in:
parent
fddd1c6b84
commit
0241354dc1
@ -40,6 +40,7 @@ my $output = '';
|
|||||||
my $max_glucose = 8;
|
my $max_glucose = 8;
|
||||||
my $min_glucose = 4;
|
my $min_glucose = 4;
|
||||||
my $graph_max = 21;
|
my $graph_max = 21;
|
||||||
|
my $noicons = 0;
|
||||||
my $units = '';
|
my $units = '';
|
||||||
my $page = 'a4';
|
my $page = 'a4';
|
||||||
my $graphs_per_page = 2;
|
my $graphs_per_page = 2;
|
||||||
@ -50,6 +51,7 @@ GetOptions ("input=s" => \$input, # The name of the CSV file from wh
|
|||||||
"max:i" => \$graph_max, # The highest displayed glucose level on each graph
|
"max:i" => \$graph_max, # The highest displayed glucose level on each graph
|
||||||
"units:s" => \$units, # mmol/L or mg/dL
|
"units:s" => \$units, # mmol/L or mg/dL
|
||||||
"pagesize:s" => \$page, # size of page to print
|
"pagesize:s" => \$page, # size of page to print
|
||||||
|
"noicons" => \$noicons, # include icons (yes or no)
|
||||||
"graphs:i" => \$graphs_per_page)# The number of days printed on each page
|
"graphs:i" => \$graphs_per_page)# The number of days printed on each page
|
||||||
or die $error;
|
or die $error;
|
||||||
|
|
||||||
@ -106,6 +108,10 @@ while ( my $row = <$ifh> ) {
|
|||||||
|
|
||||||
# Parse CSV into whitespace-separated tokens to avoid conflicting separators
|
# 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"#;
|
$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;
|
push @filelines, $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,5 +687,4 @@ close( $ofh )
|
|||||||
#print GNUPLOT $gnuplot_data;
|
#print GNUPLOT $gnuplot_data;
|
||||||
#close(GNUPLOT);
|
#close(GNUPLOT);
|
||||||
|
|
||||||
|
|
||||||
# vim: set expandtab shiftwidth=4 softtabstop=4 tw=1000 :
|
# vim: set expandtab shiftwidth=4 softtabstop=4 tw=1000 :
|
||||||
|
Loading…
Reference in New Issue
Block a user