projects
/
migration-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
aee3293
)
making this a little more reliable
author
Shawn Boyette
<sboyette@esilibrary.com>
Wed, 15 Apr 2009 13:54:20 +0000 (13:54 +0000)
committer
Shawn Boyette
<sboyette@esilibrary.com>
Wed, 15 Apr 2009 13:54:20 +0000 (13:54 +0000)
csv_ripper
patch
|
blob
|
history
diff --git
a/csv_ripper
b/csv_ripper
index
bf787ff
..
098d287
100755
(executable)
--- a/
csv_ripper
+++ b/
csv_ripper
@@
-20,9
+20,10
@@
open CSV, '<', shift or die "Can't open file $!\n";
while (<CSV>) {
$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";
}