1AnyData::Format::Fixed(U3s)er Contributed Perl DocumentatAinoynData::Format::Fixed(3)
2
3
4
6 AnyData::Format::Fixed - tiedhash & DBI/SQL access to Fixed length data
7
9 use AnyData;
10 my $table = adHash( 'Fixed', $filename,'r',{pattern=>'A20 A2'} );
11 while (my $row = each %$table) {
12 print $row->{name},"\n" if $row->{country} =~ /us|mx|ca/;
13 }
14 # ... other tied hash operations
15
16 OR
17
18 use DBI
19 my $dbh = DBI->connect('dbi:AnyData:');
20 $dbh->func('table1','Fixed', $filename, {pattern=>'A20 A2'},'ad_catalog');
21 my $hits = $dbh->selectall_arrayref( qq{
22 SELECT name FROM table1 WHERE country = 'us'
23 });
24 # ... other DBI/SQL operations
25
27 This is a parser for fixed length record files. You must specify an
28 unpack pattern listing the widths of the fields e.g. {pattern=>'A3 A7
29 A20'}. You can either supply the column names or let the module get
30 them for you from the first line of the file. In either case, they
31 should be a comma separated string.
32
33 Refer to <http://perldoc.perl.org/functions/pack.html> for the
34 formatting of the pattern.
35
36 Please refer to the documentation for AnyData.pm and DBD::AnyData.pm
37 for further details.
38
40 copyright 2000, Jeff Zucker <jeff@vpservices.com> all rights reserved
41
42
43
44perl v5.32.0 2020-07-28 AnyData::Format::Fixed(3)