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

I'm writing a application in perl that extracts data from a proprietary format and puts it into a .dbf file via DBI and XBase. How can I get XBase to generate the index(.ndx) files so other applications in other languages can access the database?

Replies are listed 'Best First'.
Re: XBase Indexes
by jZed (Prior) on Nov 30, 2004 at 23:36 UTC
    AFAIK, the perl XBase modules support reading of index files, but not writing (but if someone knows differently, speak up, I am not an XBase maven). There are ODBC drivers for some XBase dbms's (FoxPro IIRC) so you could possibly automate creation of index files with FoxPro + perl + DBI + DBD::ODBC.
Re: XBase Indexes
by terra incognita (Pilgrim) on Dec 01, 2004 at 16:06 UTC
    IIRC Vendors that create xBase files honor the data structure for the DB only. Each vendor has their own index format. If you open the file with another vendors implementation the Data will be accessible however the index will not be (unless they support it).
    Here are some of the index file format file extensions ndx, ntx, mdx, cdx and idx.

    Jan Pazdziora has a index reading module on their web site at http://www.fi.muni.cz/~adelton/perl/#xbase However it does not appear to write index files, only read most formats.