From 74a52a1a4bb4de4d1e70e388771ba9eaad1b543b Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 22 Feb 2013 16:49:55 -0800 Subject: [PATCH] output cvs error diagnostics and increment overflow --- txt2xls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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++; -- 2.39.5