]> git.donarmstrong.com Git - bin.git/blobdiff - txt2xls
output cvs error diagnostics and increment overflow
[bin.git] / txt2xls
diff --git a/txt2xls b/txt2xls
index f6efa3a6300c5112418ba65b964372b89284f317..ea2c87bd7dfe4ca08ddc8a3b2c4b9b587d2b9d3a 100755 (executable)
--- a/txt2xls
+++ b/txt2xls
@@ -165,7 +165,7 @@ for my $file (@ARGV) {
     while (<$fh>) {
        chomp;
        # parse the line
-       die "Unable to parse line $. of $file" unless $csv->parse($_);
+       die "Unable to parse line $. of $file: ".$csv->error_diag() unless $csv->parse($_);
        my @row = $csv->fields();
        if ($row==1 and not $r_mode_autodetected) {
            @header_row = @row;
@@ -188,6 +188,7 @@ for my $file (@ARGV) {
            my $maxlen = 31-length('.'.$overflow);
            $t_ws_name =~ s{^(.{0,$maxlen}).*$}{$1};
            $ws = $wb->add_worksheet($ws_name.'.'.$overflow);
+            $overflow++;
            $row=1;
            output_row(\@header_row,$row,$ws,$wb,\%wb_formats,\%options);
            $row++;