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

Duplicate Sections

Open chasewallis opened this issue 5 years ago • 2 comments

I have to read an ini file in this format:

[Peer]
PeerInformation = important-info-here

[Peer]
PeerInformation = more-important-info

Attempting to parse with AllowDuplicateSections and AllowDuplicateKeys just merges the information into 1 section. I didn't see any other option that would allow both sections to exist. Looking into the code, the sections are stored in a dictionary with the section name as the key. I'm not seeing a way to easily make this happen.

Is this enhancement something that this project would want or is this ini format not expected and will never be supported?

chasewallis avatar May 28 '20 18:05 chasewallis

I have created a .NET library that solves this problem. I'm glad if you use it.

https://github.com/yuusakuri/Ini

yuusakuri avatar Sep 21 '21 10:09 yuusakuri

@chasewallis This is exactly what I'm trying to do, for wireguard configs. Unfortunately same issue. I think I'll just build my own serializer.

stamler avatar Nov 18 '22 20:11 stamler