Coder Social home page Coder Social logo

dbfpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dbfpy's Issues

Error with from dbfpy import dbf

When I try to import dbf from bdfpy I get the following errors:

print repr(_dbf) is incorrect format.

When I edit line 303 in dbf.py to update to new syntax I get the following errors:
"File "C:/ProgramData/Anaconda3/Lib/site-packages/dbfpy/dbf.py", line 67, in
import header"

Error with dbase dbf files

Hi Steelwing,

i feel confused with this part of code
in file dbfpy/header.py, line 160

             if pos != field.start:
                raise ValueError(
                    'dbf fields definition is corrupt, '
                    'fields start does not match.'
                )

using a dbase file, it returns another number, so i reviewed your dbf files included in your test folder, i saw the dbf is of Visual Foxpro right?.

I tried my own test with a dbase file, and the field.start is set with 1271005187, so in the if statement it return me a raise statement, if commented the statement does not retrieve the values of the fields because i guess the position is important to retrieve the right value, for that reason only commented the raise statement and i set the field.start with the pos variable and it works.

>>> string=b'NORMAL\x00\x00\x00\x00\x00N\x03\x00\xc2K\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>> struct.unpack('< 11s c I 3B I B', string[:24])
(b'NORMAL\x00\x00\x00\x00\x00', b'N', 1271005187, 4, 0, 0, 256, 0)

Well the way to solve my problem is it:

            if pos != field.start:
                field.start = pos
                """
                raise ValueError(
                    'dbf fields definition is corrupt, '
                    'fields start does not match.'
                )
                """

i tested with the table.dbf and it works, so maybe you can include this change, to make compatible with dbf from dbase III and Visual Foxpro because the variable pos did set fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.