160 |
} |
} |
161 |
if ($filter) { |
if ($filter) { |
162 |
no strict 'refs'; |
no strict 'refs'; |
163 |
$display_data .= join($delimiter,&$filter($display)); |
if ($display_data) { |
164 |
|
$display_data .= $delimiter.join($delimiter,&$filter($display)); |
165 |
|
} else { |
166 |
|
$display_data = join($delimiter,&$filter($display)); |
167 |
|
} |
168 |
} else { |
} else { |
169 |
if ($display_data) { |
if ($display_data) { |
170 |
$display_data .= $delimiter.$display; |
$display_data .= $delimiter.$display; |
171 |
} else { |
} else { |
172 |
$display_data .= $display; |
$display_data = $display; |
173 |
} |
} |
174 |
} |
} |
175 |
} |
} |
185 |
if (@index_data) { |
if (@index_data) { |
186 |
if ($index_filter) { |
if ($index_filter) { |
187 |
no strict 'refs'; |
no strict 'refs'; |
188 |
foreach my $d (&$index_filter(@index_data)) { |
foreach my $d (@index_data) { |
189 |
$index->insert($field, $d, $path); |
$index->insert($field, &$index_filter($d), $path); |
190 |
} |
} |
191 |
} else { |
} else { |
192 |
foreach my $d (@index_data) { |
foreach my $d (@index_data) { |
336 |
# if so, erase it and re-open database |
# if so, erase it and re-open database |
337 |
sub check_txt_db { |
sub check_txt_db { |
338 |
my $isis_db = shift || die "need isis database name"; |
my $isis_db = shift || die "need isis database name"; |
339 |
|
my $reopen = 0; |
340 |
|
|
341 |
if (-e $isis_db.".TXT") { |
if (-e $isis_db.".TXT") { |
342 |
print STDERR "WARNING: removing .txt OpenIsis database...\n"; |
print STDERR "WARNING: removing $isis_db.TXT OpenIsis database...\n"; |
343 |
unlink $isis_db.".TXT" || warn "unlink error on '$isis_db.TXT': $!"; |
unlink $isis_db.".TXT" || warn "FATAL: unlink error on '$isis_db.TXT': $!"; |
344 |
my $db = OpenIsis::open( $isis_db ); |
$reopen++; |
345 |
return $db; |
} |
346 |
|
if (-e $isis_db.".PTR") { |
347 |
|
print STDERR "WARNING: removing $isis_db.PTR OpenIsis database...\n"; |
348 |
|
unlink $isis_db.".PTR" || warn "FATAL: unlink error on '$isis_db.PTR': $!"; |
349 |
|
$reopen++; |
350 |
} |
} |
351 |
|
return OpenIsis::open( $isis_db ) if ($reopen); |
352 |
} |
} |
353 |
|
|
354 |
# EOF error |
# EOF error |
355 |
if ($db == -1) { |
if ($db == -1) { |
356 |
$db = check_txt_db($isis_db); |
$db = check_txt_db($isis_db); |
357 |
if (! $db) { |
if ($db == -1) { |
358 |
print STDERR "FATAL: OpenIsis can't open zero size file $isis_db\n"; |
print STDERR "FATAL: OpenIsis can't open zero size file $isis_db\n"; |
359 |
next; |
next; |
360 |
} |
} |
403 |
} |
} |
404 |
} |
} |
405 |
} |
} |
406 |
|
# for this to work with current version of OpenIsis (0.9.0) |
407 |
|
# you might need my patch from |
408 |
|
# http://www.rot13.org/~dpavlin/projects/openisis-0.9.0-perl_close.diff |
409 |
|
OpenIsis::close($db); |
410 |
print STDERR "\n"; |
print STDERR "\n"; |
411 |
|
|
412 |
} elsif ($type_base eq "excel") { |
} elsif ($type_base eq "excel") { |