This sounds like a problem that wouldn’t have existed in the first place if following a binary protocol with a standard format and using a proper serialization library.
The issue comes from CSV files looking easy to generate by hand, when it in fact is not.