Copiar varios arquivos em um Unico.

Delphi

11/06/2008

Amigos,

Estou querendo copiar varios arquivos em um unico arquivo.
Exemplo. Arq1.txt + Arq2.txt + Arq3.txt = Arq123.txt
Ou seja, estou querendo pegar a informações dos aquivos 1, 2, 3 e jogar dentro do Arq123.txt

Desde já agradeço.


Rbarbosa75

Rbarbosa75

Curtidas 0

Respostas

Eniorm

Eniorm

11/06/2008

pelo prompt de comando:

c:\>copy arq1.txt+arq2.txt+arq3.txt arq123.txt


Pelo Delphi usando StringList;

var
  S1, S2, S3, S123 : TStringList;
begin
  S1 := TStringList.Create;
  S2 := TStringList.Create;
  S3 := TStringList.Create;
  S123 := TStringList.Create;

  S1.LoadFromFile(´arq1.txt´);
  ...
  S123.Text := S1.Text + S2.Text + S3.Text;
  S123.SaveToFile(´arq123.txt´);
  S1.Free;
  S2.Free;
  ...



GOSTEI 0
POSTAR