Repository navigation
Use OBSV8 observation count when reading XPORT files - #399
Merged
Merged
Conversation
hadley
marked this pull request as draft
October 10, 2026 18:07
Previously, trailing rows consisting entirely of blanks were discarded as end-of-file padding. For V8 files, the observation count in the `OBSV8` header is now used to read exactly that many rows. Files without a usable count (V5, or a blank/zero count) fall back to the existing heuristic.
hadley
force-pushed
the
xport-obsv8-count
branch
from
October 10, 2026 18:10
1dce133 to
ee2fa19
Compare
hadley
marked this pull request as ready for review
October 10, 2026 18:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
馃 Written by AI, reviewed by me 馃
Trailing rows that are entirely blank (e.g. a single character column ending in empty strings) are currently dropped because they're indistinguishable from the space padding at the end of the final 80-byte record. V8 files record the observation count in the
OBSV8header, which ReadStat writes but never reads, so this uses it to read exactly that many rows. V5 files, and V8 files with a blank or zero count, keep the existing heuristic.Reported in tidyverse/haven#754.