Delphi Tips&Tricks News   Tips   .NET Software   VCL Software   Search   Contacts
Ultimate Pack Special Offer!


Share this page

Follow us
LinkedIn Blogspot Twitter Facebook

Related products
Ultimate Pack  hot!
iGrid Plotter  new!
Image Editor
Runtime Fusion
Form Designer
Object Inspector
Print Suite Pro
Commented Image
Delphi Toys
WinDowse
Delphi Bonus
TMS Scripter Studio
Form Designer VB
Form Designer .NET
Print Suite .NET
Gradient Controls .NET  new!

Related links
Win32.hlp online version
MegaDetailed.NET
Delphi to C#

Special
Free Software Promotion
Offers for Resellers

Hobby projects
cdtrrracks.com
books.storrre.com
in3steps.com
sovietphillumeny.com

Append one file to other - Files & folders - Tips & Tricks - Greatis Delphi Pages

You may copy contents of a first file to [new.$] file. After that, you may add contents of a second file to [new.$] and then delete first file and rename [new.$] file to name of the first file.


procedure TForm1.Button3Click(Sender: TObject);
var
  Str: string;
  F1, F2, F3: TextFile;
begin
  Label3.Caption:='Processing...';
  AssignFile(F1, Edit1.Text);
  AssignFile(F2, Edit2.Text);
  AssignFile(F3, 'new.$');
  Reset(F1);
  Reset(F2);
  Rewrite(F3);
  while not(EOF(F1)) do
  begin
    Readln(F1, Str);
    Writeln(F3, Str);
  end;
  while not(EOF(F2)) do
  begin
    Readln(F2, Str);
    Writeln(F3, Str);
  end;
  CloseFile(F1);
  CloseFile(F2);
  CloseFile(F3);
  DeleteFile(ExtractFileName(Edit1.Text));
  RenameFile('new.$', ExtractFileName(Edit1.Text));
  DeleteFile('new.$');
  Label3.Caption:='Processing done';
end;
For more
Delphi Help

Download source