Skip to content
Snippets Groups Projects
Commit d0845e39 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- fixed header output

- add quoting if value is not a number
parent 9d9e1f0c
No related branches found
No related tags found
No related merge requests found
......@@ -10,11 +10,17 @@ use namespace::autoclean -except => qr{SLUB::LZA::TA::.*};
sub print_results($headers_ref, $result_ref) {
binmode(STDOUT, ':encoding(UTF-8)');
say join(",", @{$headers_ref});
say join(",", map {
my $l = $_;
$l=~s/_//;
$l=~s/(.*)/"$1"/;
$l;
} @{$headers_ref});
say join("\n", map {
my $line = $_;
my $res_line = join(
",",
map {m/^\d+(\.\d+)?$/ ? $_ : "\"$_\""}
map {$line->{$_} // ""} @{$headers_ref}
);
$res_line;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment