Clean up ini file automatically

itnifl
itnifl used Ask the Experts™
on
I have some manual code that cleans up a corrupt ini file, for instance removes duplicate sections and keys. I don't like using that custom code, would like to use a standard library instead. Have been looking at https://github.com/rickyah/ini-parser, but it seems to not have any automatic way of cleaning this up. If it encounters an invalid ini file with duplicate sections and keys, it throws an error.

Does anyone here know of a library out there that I can use in .Net C# that automatically fixes the problems described above?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Developer
Commented:
There is no way to do this automatically. Cause the content of a ini-file and whether it is valid depends on the application. A tool cannot know this. Especially as there is not a real grammar for ini-files. Further more, duplicate sections or keys can be valid..
itniflProgrammer

Author

Commented:
Thank you. I found an acceptable solution with self-written code instead.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial