while (<>) {
- my @F = split(/$Opt{sep}/);
+ my @F = $Opt{format} ? split(/\s*$Opt{sep}\s*/) : split(/$Opt{sep}/);
for (my $i=0;$i<@F;$i++) {
chomp($F[$i]);
- #$F[$i] =~ s/^\r//;
$F[$i] = Encode::decode_utf8($F[$i]);
my $l;
$len[$i] = $l if ( $l = length($F[$i]) ) >= ($len[$i] || 0);
exit unless @lines;
-# NB 11.07.19 Bug Wrong ! my $tot = @lines - ($Opt{header} ? 0 : 1);
my $tot = @lines - ($Opt{header} ? 1 : 0);
my $t = -1;
-my $format = "| ".join(" | ",map {$t+=$_+3; "\%-".$_."s"} @len)." |".chr(10);
+my $format = "| ".join(" | ",map {$t+=$_+3; "\%-".$_."s"} @len)." |".chr(10);
my $sep_line = "+".join("+",map {("-"x($_+2))} @len)."+".chr(10);
-print $sep_line;
+if ($Opt{format}) {
+ my $sep = " ".$Opt{sep}." ";
+ $format = join($sep,map {$t+=$_+length($sep); "\%-".$_."s"} @len).chr(10);
+ $sep_line = "";
+}
+
+print $sep_line;
my $i = 0;
my $count;
while (my $line = shift @lines)
-option[header|h!] Print or not header separotor after first row
-option[sep|s=s] Separtor
+ -option[format|f!] Only format according to option --sep. Usefull for coding
-option[verbose|v+] Verbose mode: increase the verbosity level.
-option[debug+] Debug mode: increase the verbosity level.
-option[version|V] Print version (default: $VERSION)