You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class TestFieldParser(FieldParser):
def parse00(self, field, data):
print(field.name, data)
return data
def parseR(self, field, data):
print(field.name, data)
return data
dbf = DBF('c:/base/75.dbf', encoding='cp1251', parserclass=TestFieldParser)
for rec in dbf:
pass
Traceback (most recent call last):
File "C:\Users\Dmitry\PycharmProjects\Transit\Lib\site-packages\Transit.py", line 13, in
dbf = DBF('c:/base/75.dbf', encoding='cp1251', parserclass=TestFieldParser)
File "C:\Users\Dmitry\PycharmProjects\Transit\Lib\site-packages\dbfread\dbf.py", line 123, in init
self._check_headers()
File "C:\Users\Dmitry\PycharmProjects\Transit\Lib\site-packages\dbfread\dbf.py", line 257, in _check_headers
raise ValueError(message.format(field.length))
ValueError: Field type I must have length 4 (was 0)
What does this error mean and how to fix it?
Thanks everyone
The text was updated successfully, but these errors were encountered:
I found a problem with my .dbf file.
After manual remove Field "Type" in my database by "DBF Viewer 2000" data is read correctly
But, how do i ignore this field when reading?
Hello,
I'm unsuccessfully trying to open dbf
from dbfread import DBF, FieldParser
class TestFieldParser(FieldParser):
def parse00(self, field, data):
print(field.name, data)
return data
def parseR(self, field, data):
print(field.name, data)
return data
dbf = DBF('c:/base/75.dbf', encoding='cp1251', parserclass=TestFieldParser)
for rec in dbf:
pass
Traceback (most recent call last):
File "C:\Users\Dmitry\PycharmProjects\Transit\Lib\site-packages\Transit.py", line 13, in
dbf = DBF('c:/base/75.dbf', encoding='cp1251', parserclass=TestFieldParser)
File "C:\Users\Dmitry\PycharmProjects\Transit\Lib\site-packages\dbfread\dbf.py", line 123, in init
self._check_headers()
File "C:\Users\Dmitry\PycharmProjects\Transit\Lib\site-packages\dbfread\dbf.py", line 257, in _check_headers
raise ValueError(message.format(field.length))
ValueError: Field type I must have length 4 (was 0)
What does this error mean and how to fix it?
Thanks everyone
The text was updated successfully, but these errors were encountered: