I am looking for a method to parse readable (i.e., not binary) data files with sections.
I had been using ConfigObj to read config files (INI files?), but I ran into a problem with multi-line lists. Specifically, ConfigObj does not allow list members to contain carriage returns. In other words, the following fails to parse:
[section]
data = [(1, 0.1),
(2, 0.2),
(3, 0.3)]
Removing the carriage returns fixes the problem
[section]
data = [(1, 0.1), (2, 0.2), (3, 0.3)]
Obviously, I could just use this simple fix, but the readability suffers significantly when the data extends beyond a single line. Is there an alternate config-file parser that would work here?
Alternatively, are there parsers for csv files with sections? For example, something that could parse
[data1]
1, 0.1
2, 0.2
3, 0.3
[data2]
1, 0.1
2, 0.2
3, 0.3
I considered JSON files but I wasn't quite happy with the look of the data files.
NOTE: the 1, 2, 3 columns are just for illustration: it is not my intent to save row numbers.