Clean up ini file automatically

itnifl used Ask the Experts™
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, 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?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Developer
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..


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