Search code examples
pythondbf

can't read .dbt file: Unknown dbf type


I get following error when I try to read a .dbt file with this library.

import dbf

table = dbf.Table(filename='test.dbt')
table.open(dbf.READ_ONLY)

>>dbf.DbfError: Unknown dbf type: 16 (10)

You can find the example data here.


Solution

  • The .dbt is the memo file, and cannot be opened separately from the .dbf file. What you need to do is

    table = dbf.Table(filename='test.dbf')
    

    and the fields stored in the .dbt file will automatically be available.