|< 1 2 >| | 13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl
use DBI;
$dbh = DBI->connect("DBI:CSV:f_dir=csvdb")
or die "Cannot connect: " . $DBI::errstr;
$dbh = DBI->connect("DBI:CSV:");
$dbh->{'csv_tables'}->{'index'} = {
sep_char => " ",
quote_char => undef,
eol => undef,
escape_char => undef,
always_quote => 0,
file => 'test.txt',
col_names => ["pos", "qnt", "part", "housing"]
};
my $sth=$dbh->prepare("SELECT * FROM index");
$sth->execute() or die "Cannot execute: " . $sth->errstr();
while (my @ausgabe = $sth->fetchrow_array)
{
print $ausgabe[0]."\t".$ausgabe[1]."\n";
}
$sth->finish();
$dbh->disconnect();
sep_char => qr/\s+/,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
use warnings;
use strict;
use DBI;
my $dbh = DBI->connect("DBI:CSV:f_dir=csvdb") or die "Cannot connect: " . $DBI::errstr;
$dbh = DBI->connect("DBI:CSV:");
$dbh->{'csv_tables'}->{'index'} = {
sep_char => " ",
quote_char => undef,
eol => undef,
escape_char => undef,
always_quote => 0,
file => 'test.txt',
col_names => ["pos", "qnt", "part", "housing"]
};
my $sth = $dbh->prepare("SELECT * FROM index");
$sth->execute() or die "Cannot execute: " . $sth->errstr();
while (my @ausgabe = $sth->fetchrow_array) {
print $ausgabe[0]."\t".$ausgabe[1]."\n";
} # while
$sth->finish();
$dbh->disconnect();
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
use warnings;
use strict;
use DBI;
my $dbh = DBI->connect("DBI:CSV:f_dir=csvdb") or die "Cannot connect: " . $DBI::errstr;
$dbh = DBI->connect("DBI:CSV:");
$dbh->{'csv_tables'}->{'index'} = {
sep_char => " ",
quote_char => undef,
eol => undef,
escape_char => undef,
always_quote => 0,
file => 'test.txt',
col_names => ["pos", "qnt", "part", "housing"]
};
my $sth = $dbh->prepare("SELECT * FROM index");
$sth->execute() or die "Cannot execute: " . $sth->errstr();
while (my @ausgabe = $sth->fetchrow_array) {
print $ausgabe[0]."\t".$ausgabe[1]."\n";
} # while
$sth->finish();
$dbh->disconnect();
1;
|< 1 2 >| | 13 Einträge, 2 Seiten |