Structuring an input file

Posted by Ricardo on Programmers See other posts from Programmers or by Ricardo
Published on 2013-10-16T02:23:21Z Indexed on 2013/10/17 22:19 UTC
Read the original article Hit count: 195

Filed under:
|

I am in the process of structuring a small program to perform some hydraulic analysis of pipe flow. As I am envisioning this, the program will read an input file, store the input parameters in a suitable way, operate on them and finally output results. I am struggling with how to structure the input file in a sane way; that is, in a way that a human can write it easily and a machine can parse it easily. A sample input file made available to me for a similar program is just a stream of comma-separated numbers that don't make much sense on their own, so that's the scenario I am trying to avoid.

Though I am giving the details of my particular problem, I am more interested in general input-file structuring strategies. Is a stream of comma-separated values my best bet? Would I be better off using some sort of key:value structure? I don't know much about this, so any help will probably put me in a better track than I am now.

© Programmers or respective owner

Related posts about code-formatting

Related posts about io