From: Don Armstrong Date: Sat, 23 Feb 2013 00:49:55 +0000 (-0800) Subject: output cvs error diagnostics and increment overflow X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=74a52a1a4bb4de4d1e70e388771ba9eaad1b543b;p=bin.git output cvs error diagnostics and increment overflow --- diff --git a/txt2xls b/txt2xls index f6efa3a..ea2c87b 100755 --- 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++;