Untangling multi-table spreadsheets
A finance manager who looked after the marketplace sales numbers kept receiving spreadsheets that crammed several separate tables onto one page. I couldn't change how the files arrived, so I wrote a parser that finds each table and lifts it out on its own.
A finance manager who looked after the marketplace sales numbers came to me with a spreadsheet she dreaded. Her figures arrived in files that stacked several separate tables onto a single page, blank rows and repeated headers wedged between them. Nobody upstream was going to change the format, so every week she pulled the tables apart by hand before she could use them.
I wrote a parser that reads the sheet as it comes and hands each table back on its own. A public gist gave me somewhere to start, but it fell over on the real files, so I built up from there. The parsing was never the problem. The problem was deciding where one table ended and the next began on a single page: headers that varied from file to file, columns spaced differently, a table missing a column, one logical table split across several sheets.
the whole job in one question: where does one table stop and the next start?
The demo is a spreadsheet, the kind of file the tool was built for. Open it and the detector runs down the sheet: the formula bar narrates each row it reads, blue boxes close around every table it finds, and a fresh sheet tab drops in for each one lifted out. Flip Header-aware merge off on the Expenses sheet to watch the naive split cut a table in half at its subtotal gap.
Open the sheet-splitter ↗She reckoned it gave her back three to four hours a week. That was her own estimate, but she took to praising me in front of the whole sales team, which told me the real number ran higher once you counted the Europe team behind her. Around ten colleagues, she said, were fighting the same page every week.
I shipped it as a CMD script. It did the job, but today I’d build it as a small local web app instead. UX matters, even for a tool one person runs on a Friday.
Did it ever reach those ten? I left, so I wouldn’t know.