Hello dear guest!

Boot Land is a community driven site established since 2006 and focused on data recovery/backup boot disks, research of Windows 2000/XP/2003/Vista/7 install/deployment/antivirus tools, customizing Windows PE systems and even learning how to recover from disaster situations.

How about joining our boot disk community? So do it. Life's short!

  - You get free access to our newsletter with all the interesting buzz about boot disks
  - We share publicity revenue with everyone who wishes to participate at the forums
  - Publicity is never, never, never displayed to members (along with many other cool things)
http://boot-land.net/register

 Menu



 Statistics
· Files : 300
· Downloads : 178916
 Ini Merge, Merge values from two INI files into a new file
Rate: 2/5
Informations
File name Ini Merge
Added by Nuno Brito
Add date 25-September 07
Views 1246
File size 206.96K
Downloads 430
Comment
This tool will pick two separate INI files and combine all keys sections.

The first file overwrites any matching keys on the second file and results become available on a third file.

It will also remember all settings to speed up getting all the rigth paths/files.


Here is the source code (delphi7)

CODE

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, XPMan, Inifiles, Grids, ValEdit;

type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
XPManifest1: TXPManifest;
LabeledEdit1: TLabeledEdit;
LabeledEdit2: TLabeledEdit;
LabeledEdit3: TLabeledEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
BitBtn1: TBitBtn;
BitBtn6: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
ValueListEditor1: TValueListEditor;
procedure Select_File(Sender: TObject);
procedure Create_Output(Sender: TObject);
procedure Start_Program(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}






procedure TForm1.Create_Output(Sender: TObject);
var
File1,
//File2,
OutFile : TMemIniFile;

Memo,
SectionList : TStringList;

i,r : Integer;

begin

File1 := TMemIniFile.Create(LabeledEdit1.Text);
memo := TStringList.Create;
SectionList := TStringList.Create;

// Create a fresh output file using the second file as base
memo.LoadFromFile(LabeledEdit2.Text);
memo.SaveToFile(LabeledEdit3.Text);
memo.Clear;

OutFile := TMemIniFile.Create(LabeledEdit3.Text);


// Get all sections from first file
File1.ReadSections(SectionList);

// loop throught every section
if SectionList.Count > 0
then
for i := 0 to SectionList.Count - 1
do
begin
memo.Clear;
// read all keys inside a section of file1
File1.ReadSection(SectionList[i],memo);

if memo.Count > 0
then
for r := 0 to memo.Count - 1
do
if Length(memo[r])>0
then
begin
// write each key from file1 on fileOut
OutFile.WriteString(SectionList[i],memo[r],File1.ReadString(SectionList[i],memo[
r],''));
end;

end;//for

OutFile.UpdateFile;

ShowMessage('Completed!');

file1.Free;
memo.Free;
SectionList.Free;
OutFile.Free;
end;


The download includes all source files and compiled executable.

smile.gif



Download file