]> git.nbdom.net Git - nb.git/commitdiff
Add total to csv2human
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 29 Feb 2016 14:57:23 +0000 (14:57 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 29 Feb 2016 14:57:23 +0000 (14:57 +0000)
etc/profile.d/functions

index 1f513ae255504347a122105126d8f3fc20221c27..7943a152b0bc023b3f0709d723ef81b33f4723a7 100644 (file)
@@ -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
 }