When AI Can’t Save You: Solving a Spreadsheet Parsing Problem the Old-Fashioned Way

 


In modern development, we rely heavily on AI to assist with coding, debugging, and architectural decisions. But every once in a while, a problem comes along that AI can’t quite crack—at least not without a developer who understands the underlying language and can think beyond AI’s suggestions.

Recently, I ran into exactly that scenario while working with an application that uses Excel spreadsheets as a data source. Yes, it’s not ideal. No, that part isn’t changing. The real issue was something far more painful:

The spreadsheet columns kept changing positions.

Every time a new spreadsheet arrived, the columns shifted around unpredictably. This caused the parser to misalign fields, break imports, and generally ruin my day.


What We Tried (with AI’s Help)

I paired with AI to generate a variety of solutions:

  • Custom Excel parser using NuGet packages

  • CSV parser variants

  • Multiple fallback strategies

  • Different libraries for column mapping and validation

These solutions did work… temporarily.
Then the next batch of spreadsheets arrived, the columns moved again, and everything broke.

We explored alternatives:

  • Switching to a system API instead of spreadsheets

  • Requesting more consistent exports from the vendor

Neither option was possible. And given the vendor’s behavior, I’m fairly certain the column changes are intentional—a subtle way of encouraging you to pay for their import/export service.


The Breakthrough

After a few hours of back-and-forth with AI-generated ideas, nothing was sticking. The issue wasn’t the parsing logic—it was the unpredictability of the column positions.

So I stepped back and approached it from an engineering and language perspective rather than as an “AI problem.”

That’s when the solution became obvious:

Use dynamic types.

Instead of relying on fixed column indexes—or maintaining an endless mapping table—I pulled values from the spreadsheet dynamically, then mapped those dynamic values into an already well-defined model.

This approach:

  • Removed dependency on column order

  • Simplified the entire parsing process

  • Worked consistently across all spreadsheet variations

  • Improved import speed

Once implemented, the importer went from “fragile” to “bulletproof.”


The Lesson: AI Is a Tool, Not a Substitute for Language Knowledge

This experience reinforced a critical point:

AI can generate solutions, but it can’t replace knowing your programming language.

The only reason this approach worked is that I understood what C# is capable of—specifically, its support for dynamic objects and how to manipulate them.

AI didn’t suggest that route because:

  • It relies on common patterns seen in public code

  • It optimizes for probability, not creativity

  • It has no awareness of niche combinations that experienced engineers reach for instinctively

When dealing with unusual or domain-specific problems, AI can only take you so far. You still need:

  • Understanding of the language features

  • Engineering intuition

  • Ability to reason beyond the “most likely” solution

When those two things come together—your knowledge + AI’s speed—you get the best results.


Final Takeaway

AI is an incredible co-pilot. It accelerates development, improves productivity, and suggests solutions you may not have considered.

But it cannot replace:

  • Deep language knowledge

  • Problem-solving skills

  • Engineering experience

If you rely entirely on AI, you will eventually hit a wall.
If you combine AI with real software engineering skills, you can solve problems faster—and often more elegantly—than either one could alone.


Comments

Popular posts from this blog

Yes, Blazor Server can scale!

Offline-First Strategy with Blazor PWAs: A Complete Guide ๐Ÿš€

Customizing PWA Manifest and Icons for a Polished User Experience ๐Ÿš€