Skip to content

fix: Handle trailing tabs and quoted fields in Agilent Gen5 parser#1241

Merged
nathan-stender merged 2 commits into
mainfrom
fix/agilent-gen5-trailing-tabs-encoding
Jul 14, 2026
Merged

fix: Handle trailing tabs and quoted fields in Agilent Gen5 parser#1241
nathan-stender merged 2 commits into
mainfrom
fix/agilent-gen5-trailing-tabs-encoding

Conversation

@nathan-stender

Copy link
Copy Markdown
Collaborator

Summary

  • Add chardet encoding detection for non-UTF-8 Gen5 files (e.g. files with degree symbol ° encoded as 0xB0 in Windows-1252)
  • Strip trailing tabs from all lines at read time, preventing extra DataFrame columns/rows
  • Handle quoted fields in procedure details (e.g. "Optics: Bottom, Gain: 75") by stripping quotes before parsing
  • Extract section names from first non-empty tab-delimited field, handling files with leading tabs
  • Detect and strip extra leading tab from data sections (Results, Layout, kinetic Time data)
  • Merge section data when a blank line separates header from content (e.g. Layout\n\n<data>)

These issues all originate from a specific Gen5 export variant (Synergy H1 reader) that pads every line with trailing tabs, prepends an extra tab to data rows, and quotes fields containing commas.

Test plan

  • All 65 existing Agilent Gen5 tests pass
  • All 318 vendor discovery tests pass
  • 710 non-parser tests pass
  • Target file (PR391_020 plate1.txt) parses successfully with 96 well documents

🤖 Generated with Claude Code

@nathan-stender
nathan-stender requested review from a team and slopez-b as code owners July 13, 2026 19:00
@nathan-stender
nathan-stender requested a review from tamargrey July 13, 2026 19:01
stephenworlow
stephenworlow previously approved these changes Jul 14, 2026
Some Gen5 exports (e.g. Synergy H1) produce files with trailing tabs on
every line, leading tabs on data sections, and quoted fields containing
commas. This caused multiple parse failures: header DataFrame had extra
rows, section names were quoted, kinetic/results data had shifted columns,
and non-UTF-8 encoding wasn't detected.

Fixes:
- Add chardet encoding detection for non-UTF-8 files
- Strip trailing tabs from all lines at read time
- Strip quotes from procedure detail lines in DeviceControlData
- Extract section names from first non-empty tab field (handles leading tabs)
- Detect and strip extra leading tab from data sections
- Merge section data when a blank line separates header from content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nathan-stender
nathan-stender merged commit b0b6720 into main Jul 14, 2026
9 checks passed
@nathan-stender
nathan-stender deleted the fix/agilent-gen5-trailing-tabs-encoding branch July 14, 2026 20:26
nathan-stender added a commit that referenced this pull request Jul 14, 2026
### Fixed

- Handle trailing tabs and quoted fields in Agilent Gen5 parser (#1241)
- Support SpectraMax 340PC-384 kinetic files in SoftMax Pro parser
(#1240)
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.

2 participants