CSV Header Repeated Mid-File? The Dance Studio Lobby
2026-11-02
Saturday, 9:40. You're on a plastic chair in a dance studio lobby, laptop balanced on your knees. Through the glass door, a row of six-year-olds is pretending to be trees.
You only wanted ten quiet minutes. A client sent a file on Friday night. "Just the shop orders, all quarters stuck together. Can you have the totals by Monday?"
You open it in pandas. It loads. Then you ask for a sum, and pandas answers with a wall of red.
You check the column types. Everything that should be a number says object. Every date is text.
You scroll through the raw file, and there it is, around line 4,812. The header row, again. order_id, date, amount, customer, sitting in the middle of the data as if the file had started over and nobody noticed.
The row that shouldn't be there
You scroll further. It happens again at line 9,640. And again later.
Someone stitched the quarterly exports together by copying one file under another. Each piece brought its own header along. To a human it's obvious, a little label in the wrong place. To pandas it's a row of words in a column of numbers, so the whole column becomes text.
You can see the moment you should have felt relief: you know what's wrong. It doesn't help, because knowing is not the same as having it fixed.
Your first thought is a quick filter. Drop the rows where the amount says "amount". Easy.
But then you wonder what else is hiding in there. Is one of those lines slightly different? Did a customer name get cut off? Are the dates all in the same format, or is one quarter day-first and another month-first?
The quick fix is quick for the thing you can see. It tells you nothing about the things you can't.
What it quietly costs
Nobody bills for this part. It doesn't appear on an invoice as "forty minutes of squinting at line numbers."
It costs the Saturday morning. You're physically in the lobby, but your head is inside a file. A parent next to you smiles and says the kids are doing well. You say "great" without having seen anything.
It costs a bit of your confidence, too. You tell yourself that a proper professional would have a clean way to deal with this. That someone more organised wouldn't be sitting here re-reading a file they've half-fixed twice already.
And it costs Monday, because the client call is at ten. You're already rehearsing the sentence you hope you won't need: "The numbers are nearly there, I just need a bit more time."
You don't want to say that. You want to say, "Here are your totals, and here is what I changed to get them."
The small turn
In the lobby, the music stops. The trees all fall over, giggling. Somebody's mum laughs out loud.
And you think: why am I doing this by hand again?
Not because the problem is hard. A repeated header is about the simplest mess a file can have. The trouble is that it never arrives alone. It comes with a stray space, a date that flips, a duplicate you only find after the totals look too good.
And every time, you rebuild the same careful, nervous routine from memory. Check it. Fix it. Check it again. Hope.
What if the routine already existed? What if you could point it at the file, see what it would change before it touched anything, and get a short list of what it did afterwards?
Not magic. Just a calm, boring process that does the dull checks the same way every time, so you don't have to be the one holding all of it in your head.
A different Monday
Picture the same week, with that in place.
The file arrives on Friday night. You glance at it, shrug, and close the laptop. Nothing about it is urgent anymore.
On Saturday, you're in the lobby with a coffee and nothing open. You actually watch the trees. One of them is yours, and she's doing a very serious wobble.
On Monday at 9:15, you run the cleanup. First a preview, nothing changed yet, just a plain list of what it found: three repeated header rows, a handful of dates in a different style, a few duplicate orders. You read it with your tea. It makes sense. You run it for real.
By 9:30 you have totals you trust, and a short change report you can attach to your email. When the client asks, "Why do the order counts look different from our system?", you have an answer that isn't a guess.
The call at ten is just a call. You say your numbers, and you sound like someone who knows where they came from.
That's the whole difference. Not speed for its own sake. It's the feeling that the file no longer has the upper hand.
If this was your Saturday
If you recognise yourself in that lobby chair, there's a toolkit made for exactly this kind of mess. Clean Data in Minutes – CSV & Excel Cleaning Toolkit (Python) handles duplicates, dates, phone numbers, encoding, splitting and merging, and validation. It does a dry-run first and gives you a change report afterwards, so you always see what happened to your data.
It comes with a 30-day money-back promise: if it doesn't help, you get a full refund, no questions.
You can take a look here: Clean Data in Minutes – CSV & Excel Cleaning Toolkit
Until then, enjoy the trees.
An illustrative story, written with AI assistance.