From: Nicolas Boisselier Date: Mon, 29 Feb 2016 14:57:23 +0000 (+0000) Subject: Add total to csv2human X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=c7869bb57730ae9d7e55f8aff2d1792b42d1984b;p=nb.git Add total to csv2human --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 1f513ae2..7943a152 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -469,6 +469,7 @@ END { exit unless @lines; $i = 0; $t = -1; + $tot = @lines - ($noheader ? 0 : 1); $format = "| ".join(" | ",map {$t+=$_+3; "\%-".$_."s"} @len)." |".chr(10); $sep_line = "+".join("+",map {("-"x($_+2))} @len)."+".chr(10); print $sep_line; @@ -477,6 +478,7 @@ END { print $sep_line if !$noheader and !$i++; } print $sep_line; + print "$tot Records\n"; } ' $noheader }