infused / dbf

DBF is a small, fast Ruby library for reading dBase, xBase, Clipper, and FoxPro database files.
http://rdoc.info/projects/infused/dbf
MIT License
262 stars 88 forks source link

Is NULL supported for a given value? #74

Closed thbar closed 8 years ago

thbar commented 8 years ago

Hi and first thanks for this great gem!

I haven't touched DBF files in 30 years, so bear with me :smile: If I open a given file in LibreOffice, I have one line where there's a column which is blank, while when parsing it with the gem I get a 0.0 instead.

Is NULL supported at all in dBase files (version "03" specifically)? If so, should the data come back as nil rather than 0.0?

I can provide the file privately if needed!

Thanks!

infused commented 8 years ago

dBase files prior to version 7 do not officially support NULL values, but dbf should return nil if a numeric value is uninitialized. I think this is a bug recently introduced in the new 3.x codebase. I've just released version 3.0.3 which fixes the issue.

thbar commented 8 years ago

@infused thank you for both the clarification and the release! I'll try that out on my next round.