From: Shawn Boyette Date: Wed, 15 Apr 2009 13:54:20 +0000 (+0000) Subject: making this a little more reliable X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=fac051e93b96f5250d947654aa4adf0b7489cf24 making this a little more reliable --- diff --git a/csv_ripper b/csv_ripper index bf787ff..098d287 100755 --- a/csv_ripper +++ b/csv_ripper @@ -20,9 +20,10 @@ open CSV, '<', shift or die "Can't open file $!\n"; while () { $csv->parse($_); + die "Bad data on line $.\n" if ($csv->error_diag); my @chunks = $csv->fields; my @out = (); - for (@ARGV) - { push @out, $chunks[$_]} + for my $chunk (@ARGV) + { push @out, $chunks[$chunk] } print join("\t", @out), "\n"; }