Skip to content

Fix fixed-width loader for right-justified headers#3043

Open
saulbert wants to merge 1 commit intodevelopfrom
fix/fixed-width-right-justified-3029
Open

Fix fixed-width loader for right-justified headers#3043
saulbert wants to merge 1 commit intodevelopfrom
fix/fixed-width-right-justified-3029

Conversation

@saulbert
Copy link
Copy Markdown
Collaborator

Summary

  • Fix [fixed] Parsing changes in fixed format #3029: right-justified headers (e.g. ps output with PID PPID) caused data loss because column starts were derived from header text positions
  • 13-line addition after the existing allNonspaces computation that adjusts colstarts to actual data boundaries — no other logic changed
  • Adds regression test for right-justified headers

Approach

The #2265 fix correctly uses the header to determine column positions (preventing false splits from data with internal spaces). But when headers are right-justified, data extends left of where header text starts.

After computing allNonspaces, the fix:

  1. Shifts colstarts[0] to 0 if data exists before the first header word
  2. For each subsequent colstart, finds the last all-space run between consecutive colstarts and shifts the boundary to where data actually begins

Test plan

  • All 5 test_fixed_width.py tests pass (including new test_right_justified_headers)
  • Interactive testing with ps aux | vd -f fixed or similar right-justified fixed-width output
  • Verify [fixed] split columns based on header #2265 case (data with internal spaces) still works interactively

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@saulpw
Copy link
Copy Markdown
Owner

saulpw commented Mar 24, 2026

@frosencrantz I'd appreciate you testing this if you have a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fixed] Parsing changes in fixed format

2 participants