Click here to Skip to main content
5,785,816 members and growing! (19,005 online)
Email Password   helpLost your password?
Web Development » Applications & Tools » Tools with source code     Intermediate

Scan and Merge INI Files

By Phil McGahan

A free tool to merge INI files, check for common INI file mistakes, and quickly determine how two INI files differ.
C++Windows, Visual Studio, Dev

Posted: 25 May 2000
Updated: 25 May 2000
Views: 38,160
Bookmarked: 11 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
4 votes for this Article.
Popularity: 2.81 Rating: 4.67 out of 5
0 votes, 0.0%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
0 votes, 0.0%
4
3 votes, 100.0%
5
  • Download source files - 21 Kb
  • Introduction

    This utility was written late at night at a customer site to help me determine the difference between INI settings on a machine that was configured correctly and a machine that was not executing an application correctly. Originally, it just sorted two INI files so that they could easily be compared using Windiff.exe.

    It has been expanded to do the following additional tasks:

    • Find syntax errors related to comment fields in an INI file.
    • Find duplicate section blocks in an INI file.
    • Find duplicate keys within section blocks of an INI file.
    • Sort INI files so that you can use Windiff.exe to see how they differ.
    • Merge two INI files into a third.
    • Replace system paths like "C:\Windows\" with "C:\Winnt\" when it is appropriate.


    How to use it

    Just run the exe from a command line to see example usage and documentation. The basic format is as follows:

    C:\Mytools\MergeINIFiles.exe "C:\DominantFile.INI C:\Suplimental.INI C:\Merged.INI"
    

    Because we mostly launch this tool via InstallShield, there is no GUI, unless the files contain errors or the parameters are incorrect.


    Technology used

    The INI files are read as text files so that comments are included in the result set. The program is a simple, CFile reads the text, CArray holds the text and CMap compares the text.


    Summary

    I maintain no rights or restrictions on this code. It was not plagiarized from any other source. This utility was written using a Wizard generated SDI framework. It was created using VC 5.0.


    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Phil McGahan



    Location: United States United States

    Other popular Applications & Tools articles:

    Article Top
    Sign Up to vote for this article
    You must Sign In to use this message board.
    FAQ FAQ Noise ToleranceSearch Search Messages 
     Layout  Per page   
     Msgs 1 to 2 of 2 (Total in Forum: 2) (Refresh)FirstPrevNext
    QuestionEXE Download?membergrantwic19:42 10 Sep '06  
    AnswerRe: EXE Download?memberdllmrobinson22:42 9 Dec '08  

    General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    PermaLink | Privacy | Terms of Use
    Last Updated: 25 May 2000
    Editor: Valerie Bradley
    Copyright 2000 by Phil McGahan
    Everything else Copyright © CodeProject, 1999-2009
    Web12 | Advertise on the Code Project