ini-parser icon indicating copy to clipboard operation
ini-parser copied to clipboard

Split concatenated DuplicateKeys in WriteFile

Open js69 opened this issue 8 years ago • 5 comments

Hello,

is there a way to make WriteFile split concatenated DuplicateKeys lines into single lines?

Input .ini is something like this:

[SectionX] MyVal=1 MyVal=2 MyVal=3

Reading this into a ConcatenateDuplicatedKeysIniDataParser with AllowDuplicateKeys=true and ConcatenateDuplicateKeys=true will create a key object with

MyVal=1;2;3

and WriteFile will write it to a file like that.

[SectionX] MyVal=1;2;3

I need it to write the original duplicate lines to the .ini again. Any ideas on this?

js69 avatar Apr 19 '17 13:04 js69

I'm afraid there is no way to do what you want to do right now.

rickyah avatar Apr 19 '17 22:04 rickyah

With AllowDuplicateKeys=true, Myval got 1 not three values?

ljporljp avatar Apr 27 '17 09:04 ljporljp

ljporljp, yes, with AllowDuplicateKeys=true and ConcatenateDuplicateKeys=false there is only 1 value then (the last one in the .ini).

js69 avatar Apr 28 '17 09:04 js69

Hello guys, Is there a plan when it will be possible to write duplicates in different lines?

inakuhn avatar Nov 11 '20 19:11 inakuhn

I think it would be really helpful to ensure that the write operation can produce the same that was read before. It would also be helpful to be able to define the ConcatenateSeparator.

martin-braun avatar Dec 19 '21 14:12 martin-braun