Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Which xBase module?

by parser (Acolyte)
on Mar 26, 2012 at 21:35 UTC ( [id://961760]=perlquestion: print w/replies, xml ) Need Help??

parser has asked for the wisdom of the Perl Monks concerning the following question:

Hello fellow Monks,

After a few hours of reading on CPAN and few few (mis)trials with various modules I am reduced to making inquiry - which is the superior module for reading DBF files?

I have come into posession of a few very large DBF files and I need to accurately read and munge the contents. I have no need to read indices nor to write to DBF files. The ability to query for field name and type is valuable as is at least rudimentary error handling.

Cheers

Replies are listed 'Best First'.
Re: Which xBase module?
by roboticus (Chancellor) on Mar 26, 2012 at 22:50 UTC

    parser:

    I've not used any xBase packages, but if I were going to, I'd probably try DBD::Xbase first because I use the DBI package for all other database work.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      I installed DBD::XBase and gave it a try. It works much better than the previous two modules. Especially for correct interpretation of field types.

      I am still scratching my head around how to get a list of field types but I'll read the module source and see what is being passed back.

      Cheers

        See the docs of DBI instead, the table_info() and column_info() methods. I think that's what you are looking for.

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

      I endorse DBD::Xbase. I've had it in production until a year ago when we finally abandoned the legacy FoxPro database we still had to read from.

      DBD::Xbase also comes with a handy little program, dbfdump.

      xoxo,
      Andy

        I found the nugget that is dbfdump in the XBase.pm module. It is called get_header_info and is perfect for what I am doing.

        Thanks to all for the great thoughts and advice!

        Cheers

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://961760]
Approved by planetscape
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-23 20:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found