Support for multiline values
Hello,
Is there any chance to have support for multiline values in some future versions?
[section1] key1 = "this key is on multiple rows"
It's a good idea...
Yep, very interested in this. We have some legacy INIs that older systems could handle the multi-line value. Now were having issues because we can't parse them with this new library. Other than this, the library is awesome!
Anyone know how to do this in C#? I have to change a ini file which the value is
key1 = loltest yepyepxd
and i'm breaking my head trying to do this
@SrMilton Were you able to do it? If so, it would be interesting to see your solution.
@MrDave1999 No. I was using a technique with read all lines, changing what i need and write all lines back. It's a really bad way to do this but i have no other idea.
So I did something very, very hacky... but maybe this will be useful for others.
So my problem is that I'm parsing a .pylintrc file. The attached implementation is a one-way conversion from multiline values to singleline values. This is utilising the fact that the multiline values in this format, are in fact an array of comma separated values where the last non-whitespace character conveniently is a comma. An example of such is
value = foo,
bar
When rewriting the file, it's stored as
value = foo,bar
One would have to rewrite this slightly to cover the initial use case that @johnFA90 outlines. What @SrMilton is outlining however, is quite a level more complex to cover I think. You'd basically have to fetch following lines to find the next valid start of something. Probably a fun little adventure to fix...or maybe not so fun...
Anyway, hope this file is helpful for others. multiline_parser.txt