line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Win32::Access2Text;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
62149
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
5
|
1
|
|
|
1
|
|
450
|
use DBI;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.03';
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN {
|
10
|
|
|
|
|
|
|
use Exporter;
|
11
|
|
|
|
|
|
|
our @ISA = qw( Exporter );
|
12
|
|
|
|
|
|
|
our @EXPORT = qw( );
|
13
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( );
|
14
|
|
|
|
|
|
|
our @EXPORT_OK = qw( &AccTabSaveToText );
|
15
|
|
|
|
|
|
|
}
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub AccTabSaveToText($$$$) {
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my ($connectionString, $fileMdb, $tabMdb, $fileTxt) = (shift, shift, shift, shift);
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $connect = DBI->connect("dbi:ADO:Data Source=".$fileMdb.$connectionString, "");
|
22
|
|
|
|
|
|
|
my $selectAll = $connect->selectall_arrayref("SELECT * FROM [$tabMdb]");
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
open(my $fhTxt, ">", $fileTxt) or die $!;
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
foreach my $row ( @{$selectAll} ) {
|
27
|
|
|
|
|
|
|
print $fhTxt join("\t", map {defined $_?$_:''} @{$row})."\n";
|
28
|
|
|
|
|
|
|
} # foreach
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
close($fhTxt) or die $!;
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$fileTxt;
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} # AccTabSaveToText
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1;
|
37
|
|
|
|
|
|
|
__END__
|