Hacker News new | past | comments | ask | show | jobs | submit login

That sounds like a very weird format.

Care to post a mini-example with fake data so we can better understand what you are describing?




It sounds like an X12-style EDI format. They'll frequently have fields (or parts of fields) that can enable alternative blocks that may be of a different size. I had to write and maintain EDI interfaces for four years at a major retailer: there's a good business in transforming those documents.


I guess something like:

    First name
    Last name
    Credit score
    Debtor bank
    Debts
    Bank balance
but:

    First name
    Middle name
    Last name
    Credit score
    Bank balance
So subsequent fields change depending on what fields came before. Something like that.


It's not as weird as it sounds, you're parsing a text stream, not that much different in principle than parsing HTTP headers or network packets byte by byte.


They are far from the only ones. Many times these horrible formats are covered by an NDA, so I can't even open source the parser if I wanted to :-(




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: