Comments (1)
I am having the same problem. I have a program that reads any .dbf file and dynamically copies data based on the meta data for that file. It knows nothing about the data within the file. It can read MANY (20+) Visual FoxPro1 files just fine. But there are 2 files that are defined identically that when it reads the first record, the first 232 bytes of the record contain 0x00 followed by the data that I expected to see at the beginning of the record. when it reads the second record, the first 232 bytes are the tail end of the first record. It appears that the offset for the data being read is not correct.
It turns out that there are 232 bytes between the header record terminator byte (0x0D) and the beginning of the first record.
After opening the file, all of the meta data seems correct to me.
The file contains:
00000000
: 30 11 04 16 66 00 00 00 E8 20 21 06 00 00 00 00
00000010
: 00 00 00 00 00 00 00 00 00 00 00 00 01 03 00 00
00000020
: 49 4E 44 43 4F 44 45 00 00 00 00 43 01 00 00 00
:
00001FC0
: 49 4E 44 43 4F 44 45 00 00 00 00 43 01 00 00 00
00001FD0
: 20 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00
00001FE0
: 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00001FF0
: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
: same to
000020E0
: 00 00 00 00 00 00 00 00 20 30 31 30 33 20 32 31
After opening the file DbfMetadata contains:
- type VisualFoxPro1
- recordsQty 102
- fullHeaderLength 8424
- oneRecordLength 1569
All of the above are exactly as I expect. But, when I read the first record, the first 232 bytes contain 0x00 followed by the data that is at offset 0x20E8 into the file (0x20 0x30 0x31 0x30 0x33 0x20 0x32 0x31).
For those experiencing this same problem, here is my temporary workaround:
// Setup the file as usual
File dbfFile = new File( dbfPath + table + ".dbf" );
InputStream tblDbf = new FileInputStream( dbfFile );
DbfReader tblReader = new DbfReader( tblDbf );
// Bad record workaround
tblReader.read();
tblReader.findFirstRecord();
from jdbf.
Related Issues (20)
- Problem reading Float HOT 7
- Error reading memo fields HOT 1
- Better diagnostic of corrupted files HOT 3
- Java SE 6 compliance HOT 1
- Cannot open Generated DBF file in Visual fox Pro HOT 1
- dBASE Level 7
- to change the scope of the method getInteger to public HOT 2
- Doesn't work with my .dbf files
- MemoReader.read() method reading from wrong location HOT 5
- Compilation failure HOT 1
- the date of last update which store in 1-3bytes of DBF file is incrorect
- Problem reading Double solved HOT 1
- Character length HOT 1
- Dbeaver
- i am getting 'E' values instead of double numbers
- Incorrect file date. HOT 1
- Error creating dbf when Integer fields are defined.
- Cannot open dbf generated from net.iryndin.jdbf.TestDbfWriter
- Dead loop in JDK1.8 when DBF file size is over Integer.MAX_VALUE(2^31 - 1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jdbf.