$stat->{file}->{$file}->{lines}++;
$stat->{file}->{$file}->{columns}->{ $#$row }++;
- if ( ! exists $stat->{file}->{$file}->{header} ) {
- $stat->{file}->{$file}->{header} = $row;
+ if ( ! exists $data_headers[$val] ) {
$data_headers[$val] = $row;
next;
}
my $c_id = $row->[0];
my $c_s = $row->[1];
my $c_r = $row->[2];
- $row->[0] =~ s/[^A-Z0-9]+//g && $stat->{file}->{$file}->{corrupt_id}->{$c_id}++ && print 'c0';
+ $row->[0] =~ s/[^\w\d]+//ig && $stat->{file}->{$file}->{corrupt_id}->{$c_id}++ && print 'c0';
$row->[1] =~ s/\D+//g && $stat->{file}->{$file}->{corrupt_s}->{$c_s}++ && print 'c1';
$row->[2] =~ s/\D+//g && $stat->{file}->{$file}->{corrupt_r}->{$c_r}++ && print 'c2';
my $id = join('-',
}
my $o = delete $stat->{_}->{$id};
- die "FATAL: can't find $id" if ! $o;
+ die "FATAL: can't find $id" if ! $o;
my ( $id_s, $s, $r ) = split('-', $id);
my $key_s = "$s-$r";
-
+
foreach my $val ( @$o ) {
print '.';
push @{ $stat->{_}->{ $m_id } }, $val;
my $merge_file = 'merge.storable';
store $merge_ids, $merge_file;
+#print "XXX merge_ids = ", dump($merge_ids);
my $out_file = 'merged.csv';
print "out_file $out_file";